mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-05 12:24:26 +01:00
Disable watchdog on disabling receive
This commit is contained in:
@@ -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());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user