4
0
mirror of https://github.com/cwinfo/envayasms.git synced 2025-07-04 05:57:44 +00:00

add foreground service to keep App in memory (otherwise rate-limiting won't work) and provide notification

This commit is contained in:
Jesse Young
2011-09-19 18:51:45 -07:00
parent a793a5f2e3
commit 9a574b3ab4
10 changed files with 268 additions and 22 deletions

View File

@ -58,6 +58,9 @@ public final class App extends Application {
// intent to signal to Main activity (if open) that log has changed
public static final String LOG_INTENT = "org.envaya.kalsms.LOG";
public static final String START_INTENT = "org.envaya.kalsms.START";
public static final String STOP_INTENT = "org.envaya.kalsms.STOP";
public static final String QUERY_EXPANSION_PACKS_INTENT = "org.envaya.kalsms.QUERY_EXPANSION_PACKS";
public static final String QUERY_EXPANSION_PACKS_EXTRA_PACKAGES = "packages";
@ -141,9 +144,15 @@ public final class App extends Application {
mmsObserver = new MmsObserver(this);
mmsObserver.register();
setOutgoingMessageAlarm();
setOutgoingMessageAlarm();
updateEnabledNotification();
}
public void updateEnabledNotification()
{
startService(new Intent(this, ForegroundService.class));
}
public synchronized String chooseOutgoingSmsPackage()
{
outgoingMessageCount++;