From e9d1d080db3bbc6f862ca31cee4083fb5b7bf9d8 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Wed, 23 Jul 2025 10:55:07 -0700 Subject: [PATCH] Move call to setEthernetEnabled inside setIncludeTestInterfaces setIncludeTestInterfaces() pretty much always requires a call to setEthernetEnabled(currentState) afterwards as a synchronization mechanism. Add this call directly inside the helper function for simplicity. Test: TH Flag: EXEMPT mainline Change-Id: I4c787e9c560ffe60c981ac2e2a730e96138707cb --- .../cts/net/src/android/net/cts/EthernetManagerTest.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt index d1b9f8a89c..06e34cb091 100644 --- a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt +++ b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt @@ -467,6 +467,9 @@ class EthernetManagerTest { runAsShell(NETWORK_SETTINGS) { em.setIncludeTestInterfaces(value) } + // Wait for the call to be processed by calling setEthernetEnabled() which waits on a + // completion callback. + setEthernetEnabled(ethernetEnabled) } private fun removeInterface(iface: EthernetTestInterface) { @@ -710,18 +713,15 @@ class EthernetManagerTest { val iface2 = createInterface() val iface3 = createInterface() - // Prevent test interfaces from being tracked and wait for the call to be processed by - // calling setEthernetEnabled() which waits on a completion callback. + // Prevent test interfaces from being tracked. setIncludeTestInterfaces(false) - setEthernetEnabled(true) val listener = EthernetStateListener() addInterfaceStateListener(listener) listener.assertNoCallback() - // Include test interfaces again, and ensure that they are tracked properly. + // Include test interfaces again. setIncludeTestInterfaces(true) - setEthernetEnabled(true) listener.expectCallback(iface1, STATE_LINK_UP, ROLE_CLIENT) listener.expectCallback(iface2, STATE_LINK_UP, ROLE_CLIENT)