Skip starting sync service on watchdog when receiving disabled

pull/182/head
M66B 5 years ago
parent 66eea4221a
commit eebf062b4e

@ -2012,9 +2012,12 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
} }
static void watchdog(Context context) { static void watchdog(Context context) {
start(context, SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
new Intent(context, ServiceSynchronize.class) boolean enabled = prefs.getBoolean("enabled", true);
.setAction("watchdog")); if (enabled)
start(context,
new Intent(context, ServiceSynchronize.class)
.setAction("watchdog"));
} }
private static void start(Context context, Intent intent) { private static void start(Context context, Intent intent) {

Loading…
Cancel
Save