Merge "wifi: hotspot2: add Passpoint APIs to WifiManager" am: 0295d7bd38 am: 5451f8279e am: 8e07f4a86e
am: 6405b98114
Change-Id: Ifb223a9c0573571875979a7f55e6ede53ac12a4e
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 017525b..bc38284 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -16,6 +16,7 @@
package android.net.wifi;
+import android.net.wifi.hotspot2.PasspointConfiguration;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.ScanSettings;
@@ -63,6 +64,12 @@
int modifyPasspointManagementObject(String fqdn,
in List<PasspointManagementObjectDefinition> mos);
+ boolean addPasspointConfiguration(in PasspointConfiguration config);
+
+ boolean removePasspointConfiguration(in String fqdn);
+
+ List<PasspointConfiguration> getPasspointConfigurations();
+
void queryPasspointIcon(long bssid, String fileName);
int matchProviderWithCurrentNetwork(String fqdn);
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 18a580e..98a6ca5 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -26,6 +26,7 @@
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
+import android.net.wifi.hotspot2.PasspointConfiguration;
import android.os.Binder;
import android.os.Build;
import android.os.Handler;
@@ -871,6 +872,56 @@
}
/**
+ * Add a Passpoint configuration. The configuration provides a credential
+ * for connecting to Passpoint networks that are operated by the Passpoint
+ * service provider specified in the configuration.
+ *
+ * Each configuration is uniquely identified by its FQDN (Fully Qualified Domain
+ * Name). In the case when there is an existing configuration with the same base
+ * domain, the new configuration will replace the existing configuration.
+ *
+ * @param config The Passpoint configuration to be added
+ * @return true on success or false on failure
+ * @hide
+ */
+ public boolean addPasspointConfiguration(PasspointConfiguration config) {
+ try {
+ return mService.addPasspointConfiguration(config);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Remove a Passpoint configuration identified by its FQDN (Fully Qualified Domain Name).
+ *
+ * @param fqdn The FQDN of the passpoint configuration to be removed
+ * @return true on success or false on failure
+ * @hide
+ */
+ public boolean removePasspointConfiguration(String fqdn) {
+ try {
+ return mService.removePasspointConfiguration(fqdn);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Return the list of installed Passpoint configurations.
+ *
+ * @return A list of PasspointConfiguration or null
+ * @hide
+ */
+ public List<PasspointConfiguration> getPasspointConfigurations() {
+ try {
+ return mService.getPasspointConfigurations();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Query for a Hotspot 2.0 release 2 OSU icon
* @param bssid The BSSID of the AP
* @param fileName Icon file name