Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f31c217 authored by Erik Kline's avatar Erik Kline
Browse files

Always note the state of RNDIS from USB broadcasts.

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

Merged-In: I53115deda25ca83a00bd9de12891a72028647d12
Merged-In: I317b694c3a8c76077c031c4410d5b97ed79c1bbc
Merged-In: Ie226534011d6439c24cfe1957c5cf47ba171b0c0
Change-Id: I273edbe21fea586f1353ff378515401efc6bb15e
(cherry picked from commit 3897dc17)
parent 15658662
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -838,20 +838,23 @@ public class Tethering extends BaseNetworkObserver {
            //       functions are ready to use.
            //
            // For more explanation, see b/62552150 .
            synchronized (Tethering.this.mPublicSync) {
                // Always record the state of RNDIS.
                mRndisEnabled = rndisEnabled;

                if (usbConnected && !usbConfigured) {
                // Nothing for us to do here.
                // TODO: consider ignoring DISCONNECTED broadcasts as well.
                    // Nothing to do here (only CONNECTED, not yet CONFIGURED).
                    return;
                }

            synchronized (Tethering.this.mPublicSync) {
                mRndisEnabled = rndisEnabled;
                // 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;
            }
        }