diff options
author | Isaac Levy <ilevy@google.com> | 2011-06-27 15:48:15 -0700 |
---|---|---|
committer | Isaac Levy <ilevy@google.com> | 2011-06-27 18:17:42 -0700 |
commit | a2f301cc664c0dfa50e9bf8cd99231ec60bf41ff (patch) | |
tree | fd57ce9c4feddc4ae1f5c75fe39f42219b17748f | |
parent | 5754baa58c13fe38932159ed18de1e057ee30ab6 (diff) | |
download | packages_apps_Settings-a2f301cc664c0dfa50e9bf8cd99231ec60bf41ff.zip packages_apps_Settings-a2f301cc664c0dfa50e9bf8cd99231ec60bf41ff.tar.gz packages_apps_Settings-a2f301cc664c0dfa50e9bf8cd99231ec60bf41ff.tar.bz2 |
Add WifiWatchdogService toggle to Wifi Settings
Toggle is located in Settings->Wifi Settings->Advanced Wifi Settings
Change-Id: I0f8f2b6353842dae0b47dca1dd48994e42505169
-rw-r--r-- | res/values/strings.xml | 4 | ||||
-rw-r--r-- | res/xml/wifi_advanced_settings.xml | 7 | ||||
-rw-r--r-- | src/com/android/settings/wifi/AdvancedSettings.java | 13 | ||||
-rw-r--r-- | src/com/android/settings/wifi/AdvancedWifiSettings.java | 1 |
4 files changed, 25 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 1193bdc..856f461 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1082,6 +1082,10 @@ <string name="wifi_notify_open_networks">Network notification</string> <!-- Checkbox summary for option to notify user when open networks are nearby --> <string name="wifi_notify_open_networks_summary">Notify me when an open network is available</string> + <!-- Checkbox title for option to toggle wifi watchdog service --> + <string name="wifi_enable_watchdog_service">Wi-Fi Connectivity Checks</string> + <!-- Checkbox summary for option to toggle wifi watchdog service --> + <string name="wifi_enable_watchdog_service_summary">Detect and manage potential network connectivity problems</string> <!-- Setting title for setting the wifi sleep policy --> <string name="wifi_setting_sleep_policy_title">Wi-Fi disconnect policy</string> <!-- Setting summary for setting the wifi sleep policy --> diff --git a/res/xml/wifi_advanced_settings.xml b/res/xml/wifi_advanced_settings.xml index 1444de1..d7344b1 100644 --- a/res/xml/wifi_advanced_settings.xml +++ b/res/xml/wifi_advanced_settings.xml @@ -24,6 +24,13 @@ android:summary="@string/wifi_notify_open_networks_summary" android:persistent="false" /> + <!-- android:dependency="enable_wifi" --> + <CheckBoxPreference + android:key="wifi_enable_watchdog_service" + android:title="@string/wifi_enable_watchdog_service" + android:summary="@string/wifi_enable_watchdog_service_summary" + android:persistent="false" /> + <ListPreference android:key="sleep_policy" android:title="@string/wifi_setting_sleep_policy_title" diff --git a/src/com/android/settings/wifi/AdvancedSettings.java b/src/com/android/settings/wifi/AdvancedSettings.java index 4855c99..cd7b8a3 100644 --- a/src/com/android/settings/wifi/AdvancedSettings.java +++ b/src/com/android/settings/wifi/AdvancedSettings.java @@ -43,6 +43,7 @@ public class AdvancedSettings 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 WifiManager mWifiManager; @@ -72,6 +73,13 @@ public class AdvancedSettings extends SettingsPreferenceFragment Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1); notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled()); + CheckBoxPreference watchdogEnabled = + (CheckBoxPreference) findPreference(KEY_ENABLE_WIFI_WATCHDOG); + watchdogEnabled.setChecked(Secure.getInt(getContentResolver(), + Secure.WIFI_WATCHDOG_ON, 1) == 1); + + watchdogEnabled.setEnabled(mWifiManager.isWifiEnabled()); + ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND); if (mWifiManager.isDualBandSupported()) { @@ -111,12 +119,17 @@ public class AdvancedSettings extends SettingsPreferenceFragment Secure.putInt(getContentResolver(), Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, ((CheckBoxPreference) preference).isChecked() ? 1 : 0); + } else if (KEY_ENABLE_WIFI_WATCHDOG.equals(key)) { + Secure.putInt(getContentResolver(), + Secure.WIFI_WATCHDOG_ON, + ((CheckBoxPreference) preference).isChecked() ? 1 : 0); } else { return super.onPreferenceTreeClick(screen, preference); } return true; } + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java index 1da8b68..bc92b3a 100644 --- a/src/com/android/settings/wifi/AdvancedWifiSettings.java +++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java @@ -76,6 +76,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment } } + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); if (key == null) return true; |