summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Peter Qiu <zqiu@google.com> 2017-06-06 14:39:12 -0700
committer Peter Qiu <zqiu@google.com> 2017-06-13 16:00:26 +0000
commite78c25e970a4bfebbcb25e6cd1caa366e1d27c42 (patch)
tree170b20a7d550931488d21d9023e95856c1756bb1
parent63f23f8dd72d786a0477aca720e59dcbcefddfe0 (diff)
wifi: add API for retrieving Hotspot 2.0 OSU providers
For an R2 Passpoint AP, there might be zero or more OSU providers associated it. Add an API to retrieve the associated OSU providers. Bug: 62235301 Test: manual test by exercising this API in WifiTracker and verify the content of the OSU provider Change-Id: I2e730f0b16d80e0b97b4ce7cbd086b606e71eb0c Merged-In: I2e730f0b16d80e0b97b4ce7cbd086b606e71eb0c
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl3
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java23
2 files changed, 23 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 088cbc6d4a4c..7972d06e597a 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -19,6 +19,7 @@ package android.net.wifi;
import android.content.pm.ParceledListSlice;
+import android.net.wifi.hotspot2.OsuProvider;
import android.net.wifi.hotspot2.PasspointConfiguration;
import android.net.wifi.WifiConfiguration;
@@ -61,6 +62,8 @@ interface IWifiManager
WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult);
+ List<OsuProvider> getMatchingOsuProviders(in ScanResult scanResult);
+
int addOrUpdateNetwork(in WifiConfiguration config);
boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config);
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index c89a9a458393..ec8d91baf1ba 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -30,6 +30,7 @@ import android.net.DhcpInfo;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
+import android.net.wifi.hotspot2.OsuProvider;
import android.net.wifi.hotspot2.PasspointConfiguration;
import android.os.Binder;
import android.os.Build;
@@ -1000,11 +1001,9 @@ public class WifiManager {
/**
* Returns a WifiConfiguration matching this ScanResult
*
- * An {@link UnsupportedOperationException} will be thrown if Passpoint is not enabled
- * on the device.
- *
* @param scanResult scanResult that represents the BSSID
* @return {@link WifiConfiguration} that matches this BSSID or null
+ * @throws UnsupportedOperationException if Passpoint is not enabled on the device.
* @hide
*/
public WifiConfiguration getMatchingWifiConfig(ScanResult scanResult) {
@@ -1016,6 +1015,24 @@ public class WifiManager {
}
/**
+ * 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.
+ *
+ * @param scanResult scanResult that represents the BSSID
+ * @return list of {@link OsuProvider}
+ * @throws UnsupportedOperationException if Passpoint is not enabled on the device.
+ * @hide
+ */
+ public List<OsuProvider> getMatchingOsuProviders(ScanResult scanResult) {
+ try {
+ return mService.getMatchingOsuProviders(scanResult);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Add a new network description to the set of configured networks.
* The {@code networkId} field of the supplied configuration object
* is ignored.