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

Commit 7dfc73f7 authored by Eric Schwarzenbach's avatar Eric Schwarzenbach
Browse files

Remove mSeen from AccessPoint.

Clean up unused variable and associated methods.

Bug: 64533622
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java

Change-Id: Ic7e2e0e606647aed95a6fb483f7c818c81e3bf3f
parent 6fc20cbf
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();