Get network state when needed

This commit is contained in:
M66B 2020-06-16 10:51:47 +02:00
parent 779c55d58e
commit 94b775af31
1 changed files with 4 additions and 1 deletions

View File

@ -1808,7 +1808,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
return; return;
} }
if (networkState == null || accountStates == null) if (networkState == null)
networkState = ConnectionHelper.getNetworkState(ServiceSynchronize.this);
if (accountStates == null)
return; return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ServiceSynchronize.this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ServiceSynchronize.this);