diff options
author | Irfan Sheriff <isheriff@google.com> | 2012-05-31 11:15:41 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2012-05-31 11:15:41 -0700 |
commit | f0780a7cad2bb8f430d5766115f7f9f50698cfb3 (patch) | |
tree | 75a8f288d84ba398887e0546fe417828ce765673 /src | |
parent | a5ac7ce5149ea3f6f4b27259cd9fd4a23b7ac47a (diff) | |
download | packages_apps_settings-f0780a7cad2bb8f430d5766115f7f9f50698cfb3.zip packages_apps_settings-f0780a7cad2bb8f430d5766115f7f9f50698cfb3.tar.gz packages_apps_settings-f0780a7cad2bb8f430d5766115f7f9f50698cfb3.tar.bz2 |
Fix poor network detection setting
We used to base this on watchdog being turned on, but it should
be based on whether device is wifi only
Bug: 6576101
Change-Id: Ib5221287e6713c625d39ef986ceb278825fb4895
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/wifi/AdvancedWifiSettings.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java index d8a4080..bb50d2a 100644 --- a/src/com/android/settings/wifi/AdvancedWifiSettings.java +++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java @@ -43,7 +43,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment private static final String KEY_FREQUENCY_BAND = "frequency_band"; private static final String KEY_NOTIFY_OPEN_NETWORKS = "notify_open_networks"; private static final String KEY_SLEEP_POLICY = "sleep_policy"; - private static final String KEY_ENABLE_WIFI_WATCHDOG = "wifi_enable_watchdog_service"; + private static final String KEY_POOR_NETWORK_DETECTION = "wifi_poor_network_detection"; private WifiManager mWifiManager; @@ -73,16 +73,14 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1); notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled()); - boolean watchdogEnabled = Secure.getInt(getContentResolver(), - Secure.WIFI_WATCHDOG_ON, 1) != 0; - CheckBoxPreference watchdog = - (CheckBoxPreference) findPreference(KEY_ENABLE_WIFI_WATCHDOG); - if (watchdog != null) { - if (watchdogEnabled) { - watchdog.setChecked(Secure.getInt(getContentResolver(), - Secure.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 1) == 1); + CheckBoxPreference poorNetworkDetection = + (CheckBoxPreference) findPreference(KEY_POOR_NETWORK_DETECTION); + if (poorNetworkDetection != null) { + if (Utils.isWifiOnly(getActivity())) { + getPreferenceScreen().removePreference(poorNetworkDetection); } else { - getPreferenceScreen().removePreference(watchdog); + poorNetworkDetection.setChecked(Secure.getInt(getContentResolver(), + Secure.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 1) == 1); } } @@ -146,7 +144,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment Secure.putInt(getContentResolver(), Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, ((CheckBoxPreference) preference).isChecked() ? 1 : 0); - } else if (KEY_ENABLE_WIFI_WATCHDOG.equals(key)) { + } else if (KEY_POOR_NETWORK_DETECTION.equals(key)) { Secure.putInt(getContentResolver(), Secure.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, ((CheckBoxPreference) preference).isChecked() ? 1 : 0); |