summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-08-31 11:35:12 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-31 11:35:12 -0700
commitca6d987a87698cda7ca216adb8e827b30111f984 (patch)
tree12d72f4886c6ce01a922ca9420f2343c8013a122 /src/com/android/settings
parent14413a02e3ce8a2f128ec8eccdb648420e0b9297 (diff)
parent0f47465a3f73a4f013ec7958efec95ecbb848ba8 (diff)
downloadpackages_apps_Settings-ca6d987a87698cda7ca216adb8e827b30111f984.tar.gz
packages_apps_Settings-ca6d987a87698cda7ca216adb8e827b30111f984.tar.bz2
packages_apps_Settings-ca6d987a87698cda7ca216adb8e827b30111f984.zip
Merge "Fix a bug in disabling wifi tethering on a wifi-only device."
Diffstat (limited to 'src/com/android/settings')
-rw-r--r--src/com/android/settings/TetherSettings.java19
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() {