diff options
author | Mitchell Wills <mwills@google.com> | 2015-08-20 18:45:11 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-20 18:45:11 +0000 |
commit | 9fde6f2c662b63164a2930852b9e09805bdbdc24 (patch) | |
tree | 1e65e292ba3bf4b4f4a6fa013ff5e48bba95621f /packages/SettingsLib | |
parent | f8d6f72d5d8ceb267f8c9100cefc71e350217bd1 (diff) | |
parent | edf93764f09357f6062eee2e4da8da925247834a (diff) | |
download | frameworks_base-9fde6f2c662b63164a2930852b9e09805bdbdc24.zip frameworks_base-9fde6f2c662b63164a2930852b9e09805bdbdc24.tar.gz frameworks_base-9fde6f2c662b63164a2930852b9e09805bdbdc24.tar.bz2 |
am edf93764: am b460cc88: Merge "Remove wifi enabled checking from settings TetherUtil" into mnc-dr-dev
* commit 'edf93764f09357f6062eee2e4da8da925247834a':
Remove wifi enabled checking from settings TetherUtil
Diffstat (limited to 'packages/SettingsLib')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/TetherUtil.java | 24 |
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) { |