From 94b775af31e3f056df8284ac1e5634d1ea099f9a Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 16 Jun 2020 10:51:47 +0200 Subject: [PATCH] Get network state when needed --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 5 ++++- 1 file changed, 4 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 519b14b64f..97db698d63 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1808,7 +1808,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences return; } - if (networkState == null || accountStates == null) + if (networkState == null) + networkState = ConnectionHelper.getNetworkState(ServiceSynchronize.this); + + if (accountStates == null) return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ServiceSynchronize.this);