From 88fdbf3093add71eca307bc75eea7a2c54de04ec Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Thu, 5 Jun 2025 14:11:17 -0700 Subject: [PATCH] Pass EthernetPort to stopTrackingInterface Test: TH Flag: EXEMPT mainline Bug: 1000001 Change-Id: Ia96d35041cbfedb3fd4f67d43bb7238bfdd86d40 --- .../src/com/android/server/ethernet/EthernetTracker.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java index 1460b23512..ab4396584a 100644 --- a/service-t/src/com/android/server/ethernet/EthernetTracker.java +++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java @@ -238,7 +238,7 @@ public class EthernetTracker { private void onDelLink(EthernetPort port) { Log.i(TAG, "onInterfaceRemoved: " + port); - stopTrackingInterface(port.getInterfaceName()); + stopTrackingInterface(port); } private void processRtNetlinkLinkMessage(RtNetlinkLinkMessage msg) { @@ -536,7 +536,7 @@ public class EthernetTracker { for (EthernetPort port : getAllInterfaces()) { final String iface = port.getInterfaceName(); if (shouldTrackInterface(iface)) continue; - stopTrackingInterface(iface); + stopTrackingInterface(port); } } }); @@ -654,7 +654,8 @@ public class EthernetTracker { maybeUpdateServerModeInterfaceState(iface, false); } - private void stopTrackingInterface(String iface) { + private void stopTrackingInterface(EthernetPort port) { + final String iface = port.getInterfaceName(); removeInterface(iface); if (mTetheringInterface != null && iface.equals(mTetheringInterface.getInterfaceName())) { mTetheringInterface = null;