Merge pull request #916 from jotomo/ns-wifi

Disable roaming (pref) when wifi-only is enabled.
This commit is contained in:
Milos Kozak 2018-04-22 21:51:11 +02:00 committed by GitHub
commit 3b8ef50843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) { public void onStatusEvent(final EventNetworkChange ev) {
boolean wifiOnly = SP.getBoolean(R.string.key_ns_wifionly, false); boolean wifiOnly = SP.getBoolean(R.string.key_ns_wifionly, false);
String allowedSSIDs = SP.getString(R.string.key_ns_wifi_ssids, ""); 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; boolean newAllowedState = true;

View file

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