summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2015-08-20 16:58:02 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-20 16:58:02 +0000
commitb460cc88865bbdafe3f343e43bd08382c6745fe0 (patch)
tree20409ed9e0869d50eea0f1c87d89e1640725163d /packages/SettingsLib/src
parent2364af2083f4f0b00ae8275aed1aeb4193f4b89d (diff)
parent8ba94ba2ab946e5fac35db2d3bccb6674d1989c6 (diff)
downloadframeworks_base-b460cc88865bbdafe3f343e43bd08382c6745fe0.zip
frameworks_base-b460cc88865bbdafe3f343e43bd08382c6745fe0.tar.gz
frameworks_base-b460cc88865bbdafe3f343e43bd08382c6745fe0.tar.bz2
Merge "Remove wifi enabled checking from settings TetherUtil" into mnc-dr-dev
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) {