Stop listening for WiFi interface status changes
Bug: 29931437
Test: Can toggle tethering on and off repeated on shamu and an
upcoming device, both devices without a SIM.
Test: Can toggle tethering on and off repeated on an
upcoming device with a T-Mobile SIM.
Change-Id: I4986b1a5f6ae9b45010bd30639806f7ed63a605c
(cherry picked from commit d30aaeb2148edbc0c7a97699a41c450c0591b983)
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index bef48d6..6f67b6f 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -270,14 +270,16 @@
trackNewTetherableInterface(iface, interfaceType);
}
} else {
- if (interfaceType == ConnectivityManager.TETHERING_USB) {
- // ignore usb0 down after enabling RNDIS
- // we will handle disconnect in interfaceRemoved instead
- if (VDBG) Log.d(TAG, "ignore interface down for " + iface);
- } else if (tetherState != null) {
+ if (interfaceType == ConnectivityManager.TETHERING_BLUETOOTH) {
tetherState.mStateMachine.sendMessage(
TetherInterfaceStateMachine.CMD_INTERFACE_DOWN);
mTetherStates.remove(iface);
+ } else {
+ // Ignore usb0 down after enabling RNDIS.
+ // We will handle disconnect in interfaceRemoved.
+ // Similarly, ignore interface down for WiFi. We monitor WiFi AP status
+ // through the WifiManager.WIFI_AP_STATE_CHANGED_ACTION intent.
+ if (VDBG) Log.d(TAG, "ignore interface down for " + iface);
}
}
}