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

Commit fab11191 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." into...

Merge "Release the interface request when Ethernet tethering is stopped." into rvc-dev am: e8d1d95a am: ffa0666e am: 408c4cca

Change-Id: Ia2399d7e838b762deac7c09972a1d25d85c3a1e5
parents 69871940 408c4cca
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -641,22 +641,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