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

Commit 2b6dae3e authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Keep track of tetherable USB interfaces in both up and down link states." into ics

parents bba2e68b 4d525cbe
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -218,18 +218,18 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
            if (found == false) return;

            TetherInterfaceSM sm = mIfaces.get(iface);
            if (up) {
            if (up || usb) {
                // Present-at-boot USB interfaces are discovered here, and only go up after
                // RNDIS is enabled and a link is established.  Keep track of USB
                // interfaces even if they're in the down state, to avoid a race between
                // tetherUsb(true) and when the link actually goes up.
                if (sm == null) {
                    sm = new TetherInterfaceSM(iface, mLooper, usb);
                    mIfaces.put(iface, sm);
                    sm.start();
                }
            } else {
                if (isUsb(iface)) {
                    // 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 (sm != null) {
                if (sm != null) {
                    sm.sendMessage(TetherInterfaceSM.CMD_INTERFACE_DOWN);
                    mIfaces.remove(iface);
                }