1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Skip starting sync service on watchdog when receiving disabled

This commit is contained in:
M66B 2020-06-22 15:17:02 +02:00
parent 66eea4221a
commit eebf062b4e

View file

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