Disable roaming (pref) when wifi-only is enabled.

This commit is contained in:
Johannes Mockenhaupt 2018-04-22 21:43:31 +02:00
parent 6851adbfd3
commit 896f919f37
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 3 additions and 1 deletions

View file

@ -135,7 +135,7 @@ public class NSClientPlugin extends PluginBase {
public void onStatusEvent(final EventNetworkChange ev) {
boolean wifiOnly = SP.getBoolean(R.string.key_ns_wifionly, false);
String allowedSSIDs = SP.getString(R.string.key_ns_wifi_ssids, "");
boolean allowRoaming = SP.getBoolean(R.string.key_ns_allowroaming, true);
boolean allowRoaming = SP.getBoolean(R.string.key_ns_allowroaming, true) && !wifiOnly;
boolean newAllowedState = true;

View file

@ -90,6 +90,7 @@
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_ns_wifionly"
android:disableDependentsState="true"
android:title="@string/ns_wifionly" />
<EditTextPreference
@ -100,6 +101,7 @@
<SwitchPreference
android:defaultValue="true"
android:dependency="@string/key_ns_wifionly"
android:key="@string/key_ns_allowroaming"
android:title="@string/ns_allowroaming" />