From 8964a9c83004992f3933793ae4dad4620f39e5fa Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Mon, 1 Nov 2010 14:23:25 -0700 Subject: [PATCH] Remove channel control from debug builds We dont need this in the UI now that channel settings is gone. The country code setting can be done from CLI for debug purposes. Bug: 2936741 Change-Id: Ic61abac30af99611af4d67662355068cea6dd4ed --- res/values/strings.xml | 8 -- res/xml/wifi_advanced_settings.xml | 7 -- .../settings/wifi/AdvancedSettings.java | 87 +------------------ 3 files changed, 4 insertions(+), 98 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index d51001838c2..2d1a599a4a7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -999,14 +999,6 @@ Advanced - - Regulatory domain - - Set the number of channels to use - - There was a problem setting the regulatory domain. - - %1$d channels Wi-Fi sleep policy diff --git a/res/xml/wifi_advanced_settings.xml b/res/xml/wifi_advanced_settings.xml index 84964285757..7ccd58803c1 100644 --- a/res/xml/wifi_advanced_settings.xml +++ b/res/xml/wifi_advanced_settings.xml @@ -17,13 +17,6 @@ - - = 0) { - pref.setValue(String.valueOf(numChannels)); - } - } - private void initSleepPolicyPreference() { ListPreference pref = (ListPreference) findPreference(KEY_SLEEP_POLICY); pref.setOnPreferenceChangeListener(this); @@ -133,21 +68,7 @@ public class AdvancedSettings extends SettingsPreferenceFragment String key = preference.getKey(); if (key == null) return true; - if (key.equals(KEY_NUM_CHANNELS)) { - try { - int numChannels = Integer.parseInt((String) newValue); - WifiManager wifiManager = (WifiManager) getSystemService(Activity.WIFI_SERVICE); - if (!wifiManager.setNumAllowedChannels(numChannels, true)) { - Toast.makeText(getActivity(), R.string.wifi_setting_num_channels_error, - Toast.LENGTH_SHORT).show(); - } - } catch (NumberFormatException e) { - Toast.makeText(getActivity(), R.string.wifi_setting_num_channels_error, - Toast.LENGTH_SHORT).show(); - return false; - } - - } else if (key.equals(KEY_SLEEP_POLICY)) { + if (key.equals(KEY_SLEEP_POLICY)) { try { Settings.System.putInt(getContentResolver(), Settings.System.WIFI_SLEEP_POLICY, Integer.parseInt(((String) newValue))); @@ -157,7 +78,7 @@ public class AdvancedSettings extends SettingsPreferenceFragment return false; } } - + return true; } @@ -167,7 +88,7 @@ public class AdvancedSettings extends SettingsPreferenceFragment Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS); String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress(); - wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress + wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress : getActivity().getString(R.string.status_unavailable)); Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);