Disable watchdog on disabling receive

pull/187/head
M66B 4 years ago
parent 63d1e511f3
commit efe2fec79d

@ -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 =

Loading…
Cancel
Save