summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-08-09 18:54:32 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-08-09 18:54:32 +0000
commitd27af8af624c85bccdbc7bd53e66f59cfd5ad623 (patch)
tree388bde9bdcd0b1ee02ca112830e8c7c6d12888fb
parent647b520a00a21ed6cbde00baf76a3e3366885569 (diff)
parent4f31c21787951ff28645f9e4354702584be74b32 (diff)
Merge "Always note the state of RNDIS from USB broadcasts."
-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 4574fba76624..0288eb676419 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -838,20 +838,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;
}
}