diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl index 53424948d3594..3365be923a9f0 100644 --- a/wifi/java/android/net/wifi/IWifiManager.aidl +++ b/wifi/java/android/net/wifi/IWifiManager.aidl @@ -47,6 +47,8 @@ interface IWifiManager List getPrivilegedConfiguredNetworks(); + WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult); + int addOrUpdateNetwork(in WifiConfiguration config); boolean removeNetwork(int netId); diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index f8a6e3fc947a4..53550dd342297 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -622,6 +622,20 @@ public class WifiManager { } } + /** + * Returns a WifiConfiguration matching this ScanResult + * @param scanResult scanResult that represents the BSSID + * @return {@link WifiConfiguration} that matches this BSSID or null + * @hide + */ + public WifiConfiguration getMatchingWifiConfig(ScanResult scanResult) { + try { + return mService.getMatchingWifiConfig(scanResult); + } catch (RemoteException e) { + return null; + } + } + /** * Add a new network description to the set of configured networks. * The {@code networkId} field of the supplied configuration object