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

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

Merge "Remove mSeen from AccessPoint."

parents 519b5893 7dfc73f7
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -188,7 +188,6 @@ public class AccessPoint implements Comparable<AccessPoint> {
    private WifiConfiguration mConfig;

    private int mRssi = UNREACHABLE_RSSI;
    private long mSeen = 0;

    private WifiInfo mInfo;
    private NetworkInfo mNetworkInfo;
@@ -272,7 +271,6 @@ public class AccessPoint implements Comparable<AccessPoint> {

        // Do not evict old scan results on initial creation
        updateRssi();
        updateSeen();
        mId = sLastId.incrementAndGet();
    }

@@ -318,7 +316,6 @@ public class AccessPoint implements Comparable<AccessPoint> {
        this.pskType = that.pskType;
        this.mConfig = that.mConfig; //TODO: Watch out, this object is mutated.
        this.mRssi = that.mRssi;
        this.mSeen = that.mSeen;
        this.mInfo = that.mInfo;
        this.mNetworkInfo = that.mNetworkInfo;
        this.mScanResultCache.clear();
@@ -635,21 +632,6 @@ public class AccessPoint implements Comparable<AccessPoint> {
        }
    }

    /** Updates {@link #mSeen} based on the scan result cache. */
    private void updateSeen() {
        long seen = 0;
        for (ScanResult result : mScanResultCache.values()) {
            if (result.timestamp > seen) {
                seen = result.timestamp;
            }
        }

        // Only replace the previous value if we have a recent scan result to use
        if (seen != 0) {
            mSeen = seen;
        }
    }

    /**
     * Returns if the network should be considered metered.
     */
@@ -1110,7 +1092,6 @@ public class AccessPoint implements Comparable<AccessPoint> {

        mScanResultCache.put(result.BSSID, result);
        updateRssi();
        mSeen = result.timestamp; // even if the timestamp is old it is still valid
        mIsCarrierAp = result.isCarrierAp;
        mCarrierApEapType = result.carrierApEapType;
        mCarrierName = result.carrierName;
@@ -1162,7 +1143,6 @@ public class AccessPoint implements Comparable<AccessPoint> {
            /* Add or update the scan result for the BSSID */
            mScanResultCache.put(result.BSSID, result);
            if (evictOldScanResults) evictOldScanResults();
            updateSeen();
            updateRssi();
            int newLevel = getLevel();