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

Commit ed6c1e9c authored by Nalla Kartheek's avatar Nalla Kartheek
Browse files

Wifi: Check configKey for ScanResult while visibility is set.

ScanResultCache of a network may contain ScanResult of same SSID and BSSID, but
different security. Hence consider configKey of a ScanResult while visibility is
set.

Change-Id: If83a4cb09b19f611dd8e3cd66512b3429706f4b9
CRs-Fixed: 806222
parent ba9b4f7d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -575,6 +575,7 @@ public class WifiConfiguration implements Parcelable {
     ***/
    public Visibility setVisibility(long age, int configBand) {
        boolean isNetworkFound = false;
        String profileConfigKey = configKey();
        if (scanResultCache == null) {
            visibility = null;
            return null;
@@ -606,14 +607,18 @@ public class WifiConfiguration implements Parcelable {
            if ((now_ms - result.seen) > age) continue;

            if (result.is5GHz()) {
                if (profileConfigKey.equals(configKey(result))) {
                    isNetworkFound = true;
                }
                if (result.level > status.rssi5) {
                    status.rssi5 = result.level;
                    status.age5 = result.seen;
                    status.BSSID5 = result.BSSID;
                }
            } else if (result.is24GHz()) {
                if (profileConfigKey.equals(configKey(result))) {
                    isNetworkFound = true;
                }
                if (result.level > status.rssi24) {
                    status.rssi24 = result.level;
                    status.age24 = result.seen;