diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java index 9186f3575c..18d18269dd 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java @@ -148,6 +148,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr prefs.edit().putBoolean("enabled", checked).apply(); ServiceSynchronize.reschedule(getContext()); WorkerCleanup.init(getContext()); + WorkerWatchdog.init(getContext()); } }); diff --git a/app/src/main/java/eu/faircode/email/WorkerWatchdog.java b/app/src/main/java/eu/faircode/email/WorkerWatchdog.java index 8f7a68c170..00b57789df 100644 --- a/app/src/main/java/eu/faircode/email/WorkerWatchdog.java +++ b/app/src/main/java/eu/faircode/email/WorkerWatchdog.java @@ -53,7 +53,8 @@ public class WorkerWatchdog extends Worker { try { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean watchdog = prefs.getBoolean("watchdog", true); - if (watchdog) { + boolean enabled = prefs.getBoolean("enabled", true); + if (watchdog && enabled) { Log.i("Queuing " + getName() + " every " + WATCHDOG_INTERVAL + " minutes"); PeriodicWorkRequest workRequest =