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

This commit is contained in:
Treehugger Robot
2020-03-19 14:59:12 +00:00
committed by Gerrit Code Review

View File

@@ -640,21 +640,21 @@ 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);
stopTrackingInterfaceLocked(mConfiguredEthernetIface);
mConfiguredEthernetIface = null;
if (mConfiguredEthernetIface != null) {
stopTrackingInterfaceLocked(mConfiguredEthernetIface);
mConfiguredEthernetIface = null;
}
if (mEthernetCallback != null) {
mEthernetIfaceRequest.release();
mEthernetCallback = null;
mEthernetIfaceRequest = null;
}
}
private class EthernetCallback implements EthernetManager.TetheredInterfaceCallback {