Loading packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -767,10 +767,12 @@ public class WifiTrackerTest { WifiTracker tracker = createMockedWifiTracker(); startTracking(tracker); CountDownLatch ready = new CountDownLatch(1); CountDownLatch latch = new CountDownLatch(1); CountDownLatch lock = new CountDownLatch(1); tracker.mMainHandler.post(() -> { try { ready.countDown(); lock.await(); latch.countDown(); } catch (InterruptedException e) { Loading @@ -786,6 +788,9 @@ public class WifiTrackerTest { tracker.mMainHandler.sendEmptyMessage( WifiTracker.MainHandler.MSG_WIFI_STATE_CHANGED); try { ready.await(); // Make sure we have entered the first message handler } catch (InterruptedException e) {} tracker.onStop(); verify(mockWifiListener, atMost(1)).onAccessPointsChanged(); Loading Loading
packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -767,10 +767,12 @@ public class WifiTrackerTest { WifiTracker tracker = createMockedWifiTracker(); startTracking(tracker); CountDownLatch ready = new CountDownLatch(1); CountDownLatch latch = new CountDownLatch(1); CountDownLatch lock = new CountDownLatch(1); tracker.mMainHandler.post(() -> { try { ready.countDown(); lock.await(); latch.countDown(); } catch (InterruptedException e) { Loading @@ -786,6 +788,9 @@ public class WifiTrackerTest { tracker.mMainHandler.sendEmptyMessage( WifiTracker.MainHandler.MSG_WIFI_STATE_CHANGED); try { ready.await(); // Make sure we have entered the first message handler } catch (InterruptedException e) {} tracker.onStop(); verify(mockWifiListener, atMost(1)).onAccessPointsChanged(); Loading