Merge "Release the interface request when Ethernet tethering is stopped." am: 0cc7c00396 am: beac7a732f
Change-Id: I448662a926fe797f30fe45a9de5072023fb769a6
This commit is contained in:
@@ -641,21 +641,21 @@ public class Tethering {
|
|||||||
mEthernetIfaceRequest = em.requestTetheredInterface(mExecutor, mEthernetCallback);
|
mEthernetIfaceRequest = em.requestTetheredInterface(mExecutor, mEthernetCallback);
|
||||||
} else {
|
} else {
|
||||||
stopEthernetTetheringLocked();
|
stopEthernetTetheringLocked();
|
||||||
if (mEthernetCallback != null) {
|
|
||||||
mEthernetIfaceRequest.release();
|
|
||||||
mEthernetCallback = null;
|
|
||||||
mEthernetIfaceRequest = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TETHER_ERROR_NO_ERROR;
|
return TETHER_ERROR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopEthernetTetheringLocked() {
|
private void stopEthernetTetheringLocked() {
|
||||||
if (mConfiguredEthernetIface == null) return;
|
if (mConfiguredEthernetIface != null) {
|
||||||
changeInterfaceState(mConfiguredEthernetIface, IpServer.STATE_AVAILABLE);
|
stopTrackingInterfaceLocked(mConfiguredEthernetIface);
|
||||||
stopTrackingInterfaceLocked(mConfiguredEthernetIface);
|
mConfiguredEthernetIface = null;
|
||||||
mConfiguredEthernetIface = null;
|
}
|
||||||
|
if (mEthernetCallback != null) {
|
||||||
|
mEthernetIfaceRequest.release();
|
||||||
|
mEthernetCallback = null;
|
||||||
|
mEthernetIfaceRequest = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class EthernetCallback implements EthernetManager.TetheredInterfaceCallback {
|
private class EthernetCallback implements EthernetManager.TetheredInterfaceCallback {
|
||||||
|
|||||||
Reference in New Issue
Block a user