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

Commit 49ca479e authored by Quang Luong's avatar Quang Luong
Browse files

Removed OSU Provider APs of already provisioned Passpoint networks

Wifi picker should now not display an entry for an OSU Provider which
has already been used to provision a network.

Tracking bug for adding robolectric tests: b/122849296

Bug: 118705403
Test: none (yet)
Change-Id: Ifb1d6958d91e6bd4e53279cc27c72a81258a6fec
parent 02d81743
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -623,17 +623,21 @@ public class WifiTracker implements LifecycleObserver, OnStart, OnStop, OnDestro
            // TODO(b/118705403): filter out OSU Providers which we already have credentials from.
            Map<OsuProvider, List<ScanResult>> providersAndScans =
                    mWifiManager.getMatchingOsuProviders(cachedScanResults);
            Set<OsuProvider> alreadyProvisioned = mWifiManager
                    .getMatchingPasspointConfigsForOsuProviders(
                            providersAndScans.keySet()).keySet();
            for (OsuProvider provider : providersAndScans.keySet()) {
                if (!alreadyProvisioned.contains(provider)) {
                    AccessPoint accessPointOsu = new AccessPoint(mContext, provider);
                // TODO(b/118705403): accessPointOsu.setScanResults(Matching ScanResult with best
                // RSSI)
                // TODO(b/118705403): Figure out if we would need to update an OSU AP (this will be
                // used if we need to display it at the top of the picker as the "active" AP).
                // Otherwise, OSU APs should ignore attempts to update the active connection
                // info.
                    // TODO(b/118705403): accessPointOsu.setScanResults(Matching ScanResult with
                    // best RSSI)
                    // TODO(b/118705403): Figure out if we would need to update an OSU AP (this will
                    // be used if we need to display it at the top of the picker as the "active" AP)
                    // Otherwise OSU APs should ignore attempts to update the active connection info
                    // accessPointOsu.update(connectionConfig, mLastInfo, mLastNetworkInfo);
                    accessPoints.add(accessPointOsu);
                }
            }


            // If there were no scan results, create an AP for the currently connected network (if