Merge "Release the interface request when Ethernet tethering is stopped." into rvc-dev am: e8d1d95abd am: ffa0666eed

Change-Id: I244c3512c76e5c5d5a1d10415c7e89075875c253
This commit is contained in:
TreeHugger Robot
2020-03-19 19:43:25 +00:00
committed by Automerger Merge Worker

View File

@@ -641,21 +641,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 {