use of android.net.wifi.WifiNetworkScoreCache.CacheListener in project platform_frameworks_base by android.
the class WifiNetworkScoreCacheTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mockContext.getApplicationContext()).thenReturn(mockApplicationContext);
mValidScoredNetwork = buildScoredNetwork(VALID_KEY, mockRssiCurve);
mScoreCache = new WifiNetworkScoreCache(mockContext);
initializeCacheWithValidScoredNetwork();
HandlerThread thread = new HandlerThread("WifiNetworkScoreCacheTest Handler Thread");
thread.start();
mHandler = new Handler(thread.getLooper());
mLatch = new CountDownLatch(1);
mCacheListener = new CacheListener(mHandler) {
@Override
public void networkCacheUpdated(List<ScoredNetwork> updatedNetworks) {
mUpdatedNetworksCaptor = updatedNetworks;
mLatch.countDown();
}
};
}
Aggregations