summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2015-08-11 17:59:45 -0700
committerMitchell Wills <mwills@google.com>2015-08-17 18:47:08 +0000
commit8ba94ba2ab946e5fac35db2d3bccb6674d1989c6 (patch)
treed05e422609f3d475aff1e4dcb19023a0eae9f445 /packages/SettingsLib/src
parenta8f68d2da7733673d25fd1e5573539bf29b71ee4 (diff)
downloadframeworks_base-8ba94ba2ab946e5fac35db2d3bccb6674d1989c6.zip
frameworks_base-8ba94ba2ab946e5fac35db2d3bccb6674d1989c6.tar.gz
frameworks_base-8ba94ba2ab946e5fac35db2d3bccb6674d1989c6.tar.bz2
Remove wifi enabled checking from settings TetherUtil
TetherUtil no longer needs to reenable wifi when leaving SAP mode as it is now done by WifiController. WifiController will also disable wifi if needed when enabling SAP. Bug: 22729316 Change-Id: I2ffe50e6468519ca964b27ba70a7e3019fd96eb1
Diffstat (limited to 'packages/SettingsLib/src')
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/TetherUtil.java24
1 files changed, 1 insertions, 23 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java b/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java
index 58e5e29..5062423 100644
--- a/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java
+++ b/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java
@@ -54,29 +54,7 @@ public class TetherUtil {
public static boolean setWifiTethering(boolean enable, Context context) {
final WifiManager wifiManager =
(WifiManager) context.getSystemService(Context.WIFI_SERVICE);
- final ContentResolver cr = context.getContentResolver();
- /**
- * Disable Wifi if enabling tethering
- */
- int wifiState = wifiManager.getWifiState();
- if (enable && ((wifiState == WifiManager.WIFI_STATE_ENABLING) ||
- (wifiState == WifiManager.WIFI_STATE_ENABLED))) {
- wifiManager.setWifiEnabled(false);
- Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 1);
- }
-
- boolean success = wifiManager.setWifiApEnabled(null, enable);
- /**
- * If needed, restore Wifi on tether disable
- */
- if (!enable) {
- int wifiSavedState = Settings.Global.getInt(cr, Settings.Global.WIFI_SAVED_STATE, 0);
- if (wifiSavedState == 1) {
- wifiManager.setWifiEnabled(true);
- Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 0);
- }
- }
- return success;
+ return wifiManager.setWifiApEnabled(null, enable);
}
public static boolean isWifiTetherEnabled(Context context) {