Merge "Fix an NPE that can result from a race condition." into oc-dev
am: d8aa2acea3
Change-Id: I41bfd05eb74502a034cf1289032ce6a8c50bcbd5
This commit is contained in:
@@ -998,7 +998,8 @@ public class AccessPoint implements Comparable<AccessPoint> {
|
||||
if (mRssi != info.getRssi()) {
|
||||
mRssi = info.getRssi();
|
||||
updated = true;
|
||||
} else if (mNetworkInfo.getDetailedState() != networkInfo.getDetailedState()) {
|
||||
} else if (mNetworkInfo != null && networkInfo != null
|
||||
&& mNetworkInfo.getDetailedState() != networkInfo.getDetailedState()) {
|
||||
updated = true;
|
||||
}
|
||||
mInfo = info;
|
||||
|
||||
@@ -465,9 +465,9 @@ public class WifiTrackerTest {
|
||||
private void updateScoresAndWaitForAccessPointsChangedCallback() throws InterruptedException {
|
||||
// Updating scores can happen together or one after the other, so the latch countdown is set
|
||||
// to 2.
|
||||
mAccessPointsChangedLatch = new CountDownLatch(3);
|
||||
mAccessPointsChangedLatch = new CountDownLatch(2);
|
||||
updateScores();
|
||||
assertTrue("onAccessPointChanged was not called three times",
|
||||
assertTrue("onAccessPointChanged was not called twice",
|
||||
mAccessPointsChangedLatch.await(LATCH_TIMEOUT, TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user