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

Commit 1e4ae994 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Release the interface request when Ethernet tethering is stopped." am:...

Merge "Release the interface request when Ethernet tethering is stopped." am: 8281abfd am: 651ebee2

Change-Id: I8bd79fb544d6ecc3a298475eb5a9c30466d294d1
parents ce86e386 651ebee2
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -640,22 +640,22 @@ public class Tethering {
                mEthernetIfaceRequest = em.requestTetheredInterface(mExecutor, mEthernetCallback);
            } else {
                stopEthernetTetheringLocked();
                if (mEthernetCallback != null) {
                    mEthernetIfaceRequest.release();
                    mEthernetCallback = null;
                    mEthernetIfaceRequest = null;
                }
            }
        }
        return TETHER_ERROR_NO_ERROR;
    }

    private void stopEthernetTetheringLocked() {
        if (mConfiguredEthernetIface == null) return;
        changeInterfaceState(mConfiguredEthernetIface, IpServer.STATE_AVAILABLE);
        if (mConfiguredEthernetIface != null) {
            stopTrackingInterfaceLocked(mConfiguredEthernetIface);
            mConfiguredEthernetIface = null;
        }
        if (mEthernetCallback != null) {
            mEthernetIfaceRequest.release();
            mEthernetCallback = null;
            mEthernetIfaceRequest = null;
        }
    }

    private class EthernetCallback implements EthernetManager.TetheredInterfaceCallback {
        @Override