mirror of
https://github.com/cwinfo/envayasms.git
synced 2025-07-04 05:57:44 +00:00
add setting to enable/disable sms gateway
This commit is contained in:
@ -67,15 +67,18 @@ public class App {
|
||||
|
||||
int pollSeconds = getOutgoingPollSeconds();
|
||||
|
||||
if (pollSeconds > 0) {
|
||||
alarm.setRepeating(
|
||||
AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
||||
SystemClock.elapsedRealtime(),
|
||||
pollSeconds * 1000,
|
||||
pendingIntent);
|
||||
log("Checking for outgoing messages every " + pollSeconds + " sec");
|
||||
} else {
|
||||
log("Not checking for outgoing messages.");
|
||||
if (isEnabled())
|
||||
{
|
||||
if (pollSeconds > 0) {
|
||||
alarm.setRepeating(
|
||||
AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
||||
SystemClock.elapsedRealtime(),
|
||||
pollSeconds * 1000,
|
||||
pendingIntent);
|
||||
log("Checking for outgoing messages every " + pollSeconds + " sec");
|
||||
} else {
|
||||
log("Not checking for outgoing messages.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,6 +106,11 @@ public class App {
|
||||
return settings.getBoolean("launch_on_boot", false);
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return settings.getBoolean("enabled", false);
|
||||
}
|
||||
|
||||
public boolean getKeepInInbox()
|
||||
{
|
||||
return settings.getBoolean("keep_in_inbox", false);
|
||||
|
Reference in New Issue
Block a user