From f609923b4b108ca81672f5e5997d5a4d512c57e7 Mon Sep 17 00:00:00 2001 From: markchien Date: Sun, 27 Sep 2020 16:56:38 +0800 Subject: [PATCH] Remove double check interface by NetworkInterface NetworkInterface#getByName can not get the interface without IP addresses. When setIncludeTestInterfaces(true) is called, the interface will be placed in client mode, which will delete the link-local address. So calling NetworkInterface#getByName to get test interface may not work before switching to server mode. Bug: 168215721 Test: atest CtsTethering Change-Id: Ice8adcce1c4b2c86bd219c701b2afa9ba2339f24 --- .../tests/integration/src/android/net/EthernetTetheringTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java index 64be2d9a55..d206ea0b4d 100644 --- a/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java +++ b/Tethering/tests/integration/src/android/net/EthernetTetheringTest.java @@ -553,7 +553,6 @@ public class EthernetTetheringTest { TestNetworkManager tnm = mContext.getSystemService(TestNetworkManager.class); TestNetworkInterface iface = tnm.createTapInterface(); Log.d(TAG, "Created test interface " + iface.getInterfaceName()); - assertNotNull(NetworkInterface.getByName(iface.getInterfaceName())); return iface; }