diff options
author | Amith Yamasani <yamasani@google.com> | 2011-08-30 17:30:01 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2011-08-31 10:48:36 -0700 |
commit | 0f47465a3f73a4f013ec7958efec95ecbb848ba8 (patch) | |
tree | 373b4b69c8583944f26e8c2a9a607e597d9378e4 /src/com/android/settings/TetherSettings.java | |
parent | 9ca0ef5732d2d25f367b5fa01e8b6562f82d788d (diff) | |
download | packages_apps_Settings-0f47465a3f73a4f013ec7958efec95ecbb848ba8.tar.gz packages_apps_Settings-0f47465a3f73a4f013ec7958efec95ecbb848ba8.tar.bz2 packages_apps_Settings-0f47465a3f73a4f013ec7958efec95ecbb848ba8.zip |
Fix a bug in disabling wifi tethering on a wifi-only device.
Bug: 5116955
Change-Id: I924915efbd46f918bd94c124f10389912fddf41a
Diffstat (limited to 'src/com/android/settings/TetherSettings.java')
-rw-r--r-- | src/com/android/settings/TetherSettings.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java index f5bee3a4f..3ecde8079 100644 --- a/src/com/android/settings/TetherSettings.java +++ b/src/com/android/settings/TetherSettings.java @@ -56,7 +56,6 @@ public class TetherSettings extends SettingsPreferenceFragment private static final String USB_TETHER_SETTINGS = "usb_tether_settings"; private static final String ENABLE_WIFI_AP = "enable_wifi_ap"; - private static final String WIFI_AP_SETTINGS = "wifi_ap_settings"; private static final String ENABLE_BLUETOOTH_TETHERING = "enable_bluetooth_tethering"; private static final String TETHERING_HELP = "tethering_help"; private static final String USB_HELP_MODIFIER = "usb_"; @@ -115,7 +114,7 @@ public class TetherSettings extends SettingsPreferenceFragment CheckBoxPreference enableWifiAp = (CheckBoxPreference) findPreference(ENABLE_WIFI_AP); - Preference wifiApSettings = findPreference(WIFI_AP_SETTINGS); + Preference wifiApSettings = findPreference(WIFI_AP_SSID_AND_SECURITY); mUsbTether = (CheckBoxPreference) findPreference(USB_TETHER_SETTINGS); mBluetoothTether = (CheckBoxPreference) findPreference(ENABLE_BLUETOOTH_TETHERING); mTetherHelp = (PreferenceScreen) findPreference(TETHERING_HELP); @@ -135,7 +134,10 @@ public class TetherSettings extends SettingsPreferenceFragment getPreferenceScreen().removePreference(mUsbTether); } - if (!wifiAvailable) { + if (wifiAvailable) { + mWifiApEnabler = new WifiApEnabler(activity, enableWifiAp); + initWifiTethering(); + } else { getPreferenceScreen().removePreference(enableWifiAp); getPreferenceScreen().removePreference(wifiApSettings); } @@ -150,10 +152,7 @@ public class TetherSettings extends SettingsPreferenceFragment } } - mWifiApEnabler = new WifiApEnabler(activity, enableWifiAp); mView = new WebView(activity); - - initWifiTethering(); } private void initWifiTethering() { @@ -315,7 +314,9 @@ public class TetherSettings extends SettingsPreferenceFragment activity.registerReceiver(mTetherChangeReceiver, filter); if (intent != null) mTetherChangeReceiver.onReceive(activity, intent); - mWifiApEnabler.resume(); + if (mWifiApEnabler != null) { + mWifiApEnabler.resume(); + } updateState(); } @@ -325,7 +326,9 @@ public class TetherSettings extends SettingsPreferenceFragment super.onStop(); getActivity().unregisterReceiver(mTetherChangeReceiver); mTetherChangeReceiver = null; - mWifiApEnabler.pause(); + if (mWifiApEnabler != null) { + mWifiApEnabler.pause(); + } } private void updateState() { |