From 63a6065cd233b83c576d449de78db918593fb2ea Mon Sep 17 00:00:00 2001 From: Milim Lee Date: Tue, 26 May 2020 03:11:29 +0900 Subject: [PATCH] Let only Ethernet manage ethernet interface up and down When LAN link is changed for using ethernet interface from Ethernet tethering to Ethernet, there is confiict as Ethernet Tethering is trying to make ethernet link down and Ethernet is trying to make ethernet link up. So, this would make Ethernet only manage ethernet interface link state. Test: manual Bug: 130840861 Change-Id: I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc --- packages/Tethering/src/android/net/ip/IpServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/Tethering/src/android/net/ip/IpServer.java b/packages/Tethering/src/android/net/ip/IpServer.java index 1671dda4bd571..4cc35b42d93a4 100644 --- a/packages/Tethering/src/android/net/ip/IpServer.java +++ b/packages/Tethering/src/android/net/ip/IpServer.java @@ -615,8 +615,9 @@ public class IpServer extends StateMachine { final Boolean setIfaceUp; if (mInterfaceType == TetheringManager.TETHERING_WIFI - || mInterfaceType == TetheringManager.TETHERING_WIFI_P2P) { - // The WiFi stack has ownership of the interface up/down state. + || mInterfaceType == TetheringManager.TETHERING_WIFI_P2P + || mInterfaceType == TetheringManager.TETHERING_ETHERNET) { + // The WiFi and Ethernet stack has ownership of the interface up/down state. // It is unclear whether the Bluetooth or USB stacks will manage their own // state. setIfaceUp = null;