[PASSPOINT] Add API to return all matching configurations

Add API which returns all Wi-Fi configurations corresponding to
Passpoint configurations installed on the device AND usable on
the specified AP (ScanResult).

Bug: 67891871
Test: unit tests
Change-Id: Ie9e6abea23f4376f78c75d09b3a2e25e58a416b0
diff --git a/framework/java/android/net/wifi/IWifiManager.aidl b/framework/java/android/net/wifi/IWifiManager.aidl
index a3a1054..0c02ec7 100644
--- a/framework/java/android/net/wifi/IWifiManager.aidl
+++ b/framework/java/android/net/wifi/IWifiManager.aidl
@@ -62,6 +62,8 @@
 
     WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult);
 
+    List<WifiConfiguration> getAllMatchingWifiConfigs(in ScanResult scanResult);
+
     List<OsuProvider> getMatchingOsuProviders(in ScanResult scanResult);
 
     int addOrUpdateNetwork(in WifiConfiguration config);
diff --git a/framework/java/android/net/wifi/WifiManager.java b/framework/java/android/net/wifi/WifiManager.java
index b08b4b7..649b0ce 100644
--- a/framework/java/android/net/wifi/WifiManager.java
+++ b/framework/java/android/net/wifi/WifiManager.java
@@ -1029,6 +1029,26 @@
     }
 
     /**
+     * Return all matching WifiConfigurations for this ScanResult.
+     *
+     * An empty list will be returned when no configurations are installed or if no configurations
+     * match the ScanResult.
+     *
+     * @param scanResult scanResult that represents the BSSID
+     * @return A list of {@link WifiConfiguration}
+     * @throws UnsupportedOperationException if Passpoint is not enabled on the device.
+     * @hide
+     */
+    public List<WifiConfiguration> getAllMatchingWifiConfigs(ScanResult scanResult) {
+        try {
+            return mService.getAllMatchingWifiConfigs(scanResult);
+        } catch (RemoteException e) {
+            throw e.rethrowFromSystemServer();
+        }
+    }
+
+
+    /**
      * Returns a list of Hotspot 2.0 OSU (Online Sign-Up) providers associated with the given AP.
      *
      * An empty list will be returned if no match is found.