Merge "SettingsAppWidgetProvider: do not use setWifiApEnabled" into oc-dev am: bbc260d408
am: cba166d380
Change-Id: Ie639b844ab810386e8f0203e2978bf07453e35bd
diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java
index 38fed94..7dacaf5 100644
--- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java
+++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java
@@ -395,7 +395,10 @@
int wifiApState = wifiManager.getWifiApState();
if (desiredState && ((wifiApState == WifiManager.WIFI_AP_STATE_ENABLING) ||
(wifiApState == WifiManager.WIFI_AP_STATE_ENABLED))) {
- wifiManager.setWifiApEnabled(null, false);
+ final ConnectivityManager connectivityManager =
+ (ConnectivityManager) context.getSystemService(
+ Context.CONNECTIVITY_SERVICE);
+ connectivityManager.stopTethering(ConnectivityManager.TETHERING_WIFI);
}
wifiManager.setWifiEnabled(desiredState);