Always note the state of RNDIS from USB broadcasts.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 63970368

Change-Id: I273edbe21fea586f1353ff378515401efc6bb15e
This commit is contained in:
Erik Kline
2017-08-07 18:11:22 -07:00
parent cbdaf04101
commit 3897dc179f

View File

@@ -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;
}
}