mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-06 04:45:50 +01:00
Update network state on changing network settings
This commit is contained in:
@@ -131,8 +131,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
"enabled", "poll_interval" // restart account(s)
|
||||
));
|
||||
|
||||
private static final List<String> PREF_NETWORK = Collections.unmodifiableList(Arrays.asList(
|
||||
"metered", "roaming", "rlah" // update network state
|
||||
));
|
||||
|
||||
private static final List<String> 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");
|
||||
|
||||
Reference in New Issue
Block a user