diff --git a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java index 4297a73cae..d29b9d5a9e 100644 --- a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java +++ b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java @@ -771,6 +771,15 @@ public class WifiManagerTest extends AndroidTestCase { TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot(); + // add sleep to avoid calling stopLocalOnlyHotspot before TetherController initialization. + // TODO: remove this sleep as soon as b/124330089 is fixed. + try { + Log.d(TAG, "Sleep for 2 seconds"); + Thread.sleep(2000); + } catch (InterruptedException e) { + Log.d(TAG, "Thread InterruptedException!"); + } + stopLocalOnlyHotspot(callback, wifiEnabled); // wifi should either stay on, or come back on @@ -846,6 +855,15 @@ public class WifiManagerTest extends AndroidTestCase { } assertTrue(caughtException); + // add sleep to avoid calling stopLocalOnlyHotspot before TetherController initialization. + // TODO: remove this sleep as soon as b/124330089 is fixed. + try { + Log.d(TAG, "Sleep for 2 seconds"); + Thread.sleep(2000); + } catch (InterruptedException e) { + Log.d(TAG, "Thread InterruptedException!"); + } + stopLocalOnlyHotspot(callback, wifiEnabled); }