From 460592ffff4dfb50277c9df9861076fec9a1c976 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Feb 2021 08:53:55 +0100 Subject: [PATCH] Watchdog: conditionally check network --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 0f23b785e2..23cb5d2669 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -876,7 +876,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences private void onWatchdog(Intent intent) { EntityLog.log(this, "Watchdog"); schedule(this, false); - updateNetworkState(null, "watchdog"); + + if (lastNetworkState == null || !lastNetworkState.isSuitable()) + updateNetworkState(null, "watchdog"); } private NotificationCompat.Builder getNotificationService(Integer accounts, Integer operations) {