Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8aa2ace authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix an NPE that can result from a race condition." into oc-dev

parents f37f1f19 5c5cd7aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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));
    }