Disable tethering to enable Wifi
We need to explicitly disable wifi while enabling tethering and disable tethering while enabling wifi Bug: 2539071 Change-Id: I7fda6e4d9d1bb804e81561d52b5f3a982a674b0e
This commit is contained in:
@@ -92,6 +92,14 @@ public class WifiEnabler implements Preference.OnPreferenceChangeListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable tethering if enabling Wifi
|
||||
*/
|
||||
int wifiApState = mWifiManager.getWifiApState();
|
||||
if (enable && ((wifiApState == WifiManager.WIFI_AP_STATE_ENABLING) ||
|
||||
(wifiApState == WifiManager.WIFI_AP_STATE_ENABLED))) {
|
||||
mWifiManager.setWifiApEnabled(null, false);
|
||||
}
|
||||
if (mWifiManager.setWifiEnabled(enable)) {
|
||||
mCheckBox.setEnabled(false);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user