diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/networkstack/tethering/Tethering.java index ac5857d1c8..385c691025 100644 --- a/Tethering/src/com/android/networkstack/tethering/Tethering.java +++ b/Tethering/src/com/android/networkstack/tethering/Tethering.java @@ -1689,14 +1689,12 @@ public class Tethering { // If this is a Wi-Fi interface, tell WifiManager of any errors // or the inactive serving state. if (who.interfaceType() == TETHERING_WIFI) { - final WifiManager mgr = getWifiManager(); - final String iface = who.interfaceName(); - if (mgr == null) { - Log.wtf(TAG, "Skipping WifiManager notification about inactive tethering"); - } else if (who.lastError() != TETHER_ERROR_NO_ERROR) { - mgr.updateInterfaceIpState(iface, IFACE_IP_MODE_CONFIGURATION_ERROR); + if (who.lastError() != TETHER_ERROR_NO_ERROR) { + getWifiManager().updateInterfaceIpState( + who.interfaceName(), IFACE_IP_MODE_CONFIGURATION_ERROR); } else { - mgr.updateInterfaceIpState(iface, IFACE_IP_MODE_UNSPECIFIED); + getWifiManager().updateInterfaceIpState( + who.interfaceName(), IFACE_IP_MODE_UNSPECIFIED); } } } @@ -2423,19 +2421,6 @@ public class Tethering { mLog.log(iface + " is not a tetherable iface, ignoring"); return; } - - final PackageManager pm = mContext.getPackageManager(); - if ((interfaceType == TETHERING_WIFI || interfaceType == TETHERING_WIGIG) - && !pm.hasSystemFeature(PackageManager.FEATURE_WIFI)) { - mLog.log(iface + " is not tetherable, because WiFi feature is disabled"); - return; - } - if (interfaceType == TETHERING_WIFI_P2P - && !pm.hasSystemFeature(PackageManager.FEATURE_WIFI_DIRECT)) { - mLog.log(iface + " is not tetherable, because WiFi Direct feature is disabled"); - return; - } - maybeTrackNewInterfaceLocked(iface, interfaceType); }