diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 41f17a227b..316ecdb7de 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -131,8 +131,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences "enabled", "poll_interval" // restart account(s) )); + private static final List PREF_NETWORK = Collections.unmodifiableList(Arrays.asList( + "metered", "roaming", "rlah" // update network state + )); + private static final List PREF_RELOAD = Collections.unmodifiableList(Arrays.asList( - "metered", "roaming", "rlah", // force reconnect "ssl_harden", // force reconnect "badge", "unseen_ignored", // force update badge/widget "debug" // force reconnect @@ -613,7 +616,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences @Override public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { - if (PREF_EVAL.contains(key)) { + if (PREF_EVAL.contains(key) || PREF_NETWORK.contains(key)) { + if (PREF_NETWORK.contains(key)) + updateNetworkState(null, null); + Bundle command = new Bundle(); command.putString("pref", key); command.putString("name", "eval");