Merge "Release the interface request when Ethernet tethering is stopped." into rvc-dev am: e8d1d95abd am: ffa0666eed am: 408c4cca3d
Change-Id: Ia2399d7e838b762deac7c09972a1d25d85c3a1e5
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user