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:
@ -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++;
|
||||
|
Reference in New Issue
Block a user