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:
parent
66eea4221a
commit
eebf062b4e
1 changed files with 6 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue