From 17ef99be740500c9755ac31718ecaca7631fb93b Mon Sep 17 00:00:00 2001 From: "jungyee.yoo" Date: Tue, 22 Jan 2019 15:43:24 +0900 Subject: [PATCH] Add sleep to avoid calling stopLocalOnlyHotspot before TetherController initialization. Bug: 123205589 Test: run cts-on-gsi -m -m CtsNetTestCases -t android.net.wifi.cts.WifiManagerTest#testStartLocalOnlyHotspotSingleRequestByApps Bug: 123379970 Test: run cts-on-gsi -m -m CtsNetTestCases -t ndroid.net.wifi.cts.WifiManagerTest#testStartLocalOnlyHotspotSuccess Change-Id: I7506c3037dc5368d69330acc47c97c765185870f --- .../android/net/wifi/cts/WifiManagerTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 af91fbfb15..2ed012491e 100644 --- a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java +++ b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java @@ -874,6 +874,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 @@ -949,6 +958,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); } }