mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 22:56:33 +02:00
Let watchdog reschedule missed alarms
This commit is contained in:
@@ -662,6 +662,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
onAlarm(intent);
|
||||
break;
|
||||
|
||||
case "watchdog":
|
||||
onWatchdog(intent);
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.w("Unknown action: " + action);
|
||||
}
|
||||
@@ -713,6 +717,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
liveAccountNetworkState.post(command);
|
||||
}
|
||||
|
||||
private void onWatchdog(Intent intent) {
|
||||
schedule(this);
|
||||
onEval(intent);
|
||||
}
|
||||
|
||||
private NotificationCompat.Builder getNotificationService(Integer accounts, Integer operations) {
|
||||
if (accounts != null)
|
||||
this.lastAccounts = accounts;
|
||||
@@ -1910,4 +1919,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
new Intent(context, ServiceSynchronize.class)
|
||||
.setAction("alarm"));
|
||||
}
|
||||
|
||||
static void watchdog(Context context) {
|
||||
ContextCompat.startForegroundService(context,
|
||||
new Intent(context, ServiceSynchronize.class)
|
||||
.setAction("watchdog"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user