4
0
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:
Jesse Young
2011-09-13 16:06:50 -07:00
parent e79fe7ce23
commit 61d24b2f64
6 changed files with 49 additions and 17 deletions

View File

@ -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);