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

Commit 0775a98e authored by Sanket Padawe's avatar Sanket Padawe
Browse files

Fix AP showing up forever in Settings after shutting down that AP.

Bug: 22129483
Change-Id: I1f6abdb0b80c2d2fec5a7dc4026b5230cd29af7b
parent c59949dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -771,6 +771,10 @@ public class AccessPoint implements Comparable<AccessPoint> {
        }
    }

    void setRssi(int rssi) {
        mRssi = rssi;
    }

    public static String getSummary(Context context, String ssid, DetailedState state,
            boolean isEphemeral, String passpointProvider) {
        if (state == DetailedState.CONNECTED && ssid == null) {
+15 −2
Original line number Diff line number Diff line
@@ -312,6 +312,8 @@ public class WifiTracker {
            connectionConfig = getWifiConfigurationForNetworkId(mLastInfo.getNetworkId());
        }

        final Collection<ScanResult> results = fetchScanResults();

        final List<WifiConfiguration> configs = mWifiManager.getConfiguredNetworks();
        if (configs != null) {
            mSavedNetworksExist = configs.size() != 0;
@@ -326,8 +328,20 @@ public class WifiTracker {
                    }
                }
                if (mIncludeSaved) {
                    if (!config.isPasspoint() || mIncludePasspoints)
                    if (!config.isPasspoint() || mIncludePasspoints) {
                        // If saved network not present in scan result then set its Rssi to MAX_VALUE
                        boolean apFound = false;
                        for (ScanResult result : results) {
                            if (result.SSID.equals(accessPoint.getSsidStr())) {
                                apFound = true;
                                break;
                            }
                        }
                        if (!apFound) {
                            accessPoint.setRssi(Integer.MAX_VALUE);
                        }
                        accessPoints.add(accessPoint);
                    }

                    if (config.isPasspoint() == false) {
                        apMap.put(accessPoint.getSsidStr(), accessPoint);
@@ -340,7 +354,6 @@ public class WifiTracker {
            }
        }

        final Collection<ScanResult> results = fetchScanResults();
        if (results != null) {
            for (ScanResult result : results) {
                // Ignore hidden and ad-hoc networks.