Update network state on changing network settings

pull/184/head
M66B 4 years ago
parent 8dc0d2a3ba
commit 8741174287

@ -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");

Loading…
Cancel
Save