Merge "Do not use TetherUtil.setWifiTethering" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
62edbf484e
@@ -199,7 +199,9 @@ public class TetherService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disableWifiTethering() {
|
private void disableWifiTethering() {
|
||||||
TetherUtil.setWifiTethering(false, this);
|
ConnectivityManager cm =
|
||||||
|
(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
cm.stopTethering(ConnectivityManager.TETHERING_WIFI);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disableUsbTethering() {
|
private void disableUsbTethering() {
|
||||||
|
@@ -19,6 +19,7 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Icon;
|
import android.graphics.drawable.Icon;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
import android.net.wifi.WifiConfiguration;
|
import android.net.wifi.WifiConfiguration;
|
||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
@@ -102,7 +103,9 @@ public class HotspotCondition extends Condition {
|
|||||||
if (admin != null) {
|
if (admin != null) {
|
||||||
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(context, admin);
|
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(context, admin);
|
||||||
} else {
|
} else {
|
||||||
TetherUtil.setWifiTethering(false, context);
|
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(
|
||||||
|
Context.CONNECTIVITY_SERVICE);
|
||||||
|
cm.stopTethering(ConnectivityManager.TETHERING_WIFI);
|
||||||
setActive(false);
|
setActive(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -110,16 +110,6 @@ public class WifiApEnabler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSoftapEnabled(boolean enable) {
|
|
||||||
if (TetherUtil.setWifiTethering(enable, mContext)) {
|
|
||||||
/* Disable here, enabled on receiving success broadcast */
|
|
||||||
mSwitch.setEnabled(false);
|
|
||||||
} else {
|
|
||||||
mSwitch.setSummary(R.string.wifi_error);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateConfigSummary(WifiConfiguration wifiConfig) {
|
public void updateConfigSummary(WifiConfiguration wifiConfig) {
|
||||||
String s = mContext.getString(
|
String s = mContext.getString(
|
||||||
com.android.internal.R.string.wifi_tether_configure_ssid_default);
|
com.android.internal.R.string.wifi_tether_configure_ssid_default);
|
||||||
|
Reference in New Issue
Block a user