summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Erik Kline <ek@google.com> 2017-08-09 03:43:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-08-09 03:43:31 +0000
commit07df171ac67f8485aba04bf6394e93c203517408 (patch)
tree948b094fab29fc9da45915cd74e7344375b18be6
parent669f56033835fd73022e6dc8be052619e8c08e23 (diff)
parent3897dc179f23dfbaf10f0139160aa29a232144f5 (diff)
Merge "Always note the state of RNDIS from USB broadcasts." into oc-dr1-dev
-rw-r--r--services/core/java/com/android/server/connectivity/Tethering.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index b0be8f7b9635..015f7f077808 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -832,20 +832,23 @@ public class Tethering extends BaseNetworkObserver {
// functions are ready to use.
//
// For more explanation, see b/62552150 .
- if (usbConnected && !usbConfigured) {
- // Nothing for us to do here.
- // TODO: consider ignoring DISCONNECTED broadcasts as well.
- return;
- }
-
synchronized (Tethering.this.mPublicSync) {
+ // Always record the state of RNDIS.
mRndisEnabled = rndisEnabled;
+
+ if (usbConnected && !usbConfigured) {
+ // Nothing to do here (only CONNECTED, not yet CONFIGURED).
+ return;
+ }
+
// start tethering if we have a request pending
if (usbConfigured && mRndisEnabled && mUsbTetherRequested) {
tetherMatchingInterfaces(
IControlsTethering.STATE_TETHERED,
ConnectivityManager.TETHERING_USB);
}
+
+ // TODO: Figure out how to remove the need for this variable.
mUsbTetherRequested = false;
}
}