diff --git a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java index cb8c95513a..531b60fe7e 100644 --- a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java @@ -219,17 +219,10 @@ public class EthernetNetworkFactory { } /** Removes the interface from the factory and returns whether the interface was tracked */ - public boolean removeInterface(EthernetPort port) { - NetworkInterfaceState iface = mTrackingInterfaces.remove(port.getInterfaceName()); - if (iface != null) { - iface.unregisterNetworkOfferAndStop(); - return true; - } - // TODO(b/236892130): if an interface is currently in server mode, it may not be properly - // removed. - // TODO: when false is returned, do not send a STATE_ABSENT callback. - Log.w(TAG, "removeInterface() failed because port is not tracked " + port); - return false; + public void removeInterface(EthernetPort port) { + final NetworkInterfaceState iface = mTrackingInterfaces.remove(port.getInterfaceName()); + if (iface == null) return; // interface is in tethering mode; nothing to do. + iface.unregisterNetworkOfferAndStop(); } /** Returns true if state has been modified */