From 1fe2a8cfa642d3ee6b5d409ac64241e19d1c5d32 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Mon, 27 Mar 2017 15:19:22 -0700 Subject: [PATCH] wifi: document UnsupportedOperationException for Passpoint related APIs An UnsupportedOperationException will be thrown for Passpoint related API calls if Passpoint is not enabled on the device (build config config_wifi_hotspot2_enabled is set to false). Bug: None Test: None Change-Id: Id0ba1f7b80091d55a839fa3eee36baf9b45b7f5f --- wifi/java/android/net/wifi/WifiManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index ae6a6793dc9d4..acd2e44073634 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -858,6 +858,10 @@ 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 * @hide @@ -944,6 +948,8 @@ public class WifiManager { * FQDN, the new configuration will replace the existing configuration. * * An {@link IllegalArgumentException} will be thrown on failure. + * An {@link UnsupportedOperationException} will be thrown if Passpoint is not enabled + * on the device. * * @param config The Passpoint configuration to be added */ @@ -961,6 +967,8 @@ public class WifiManager { * Remove the Passpoint configuration identified by its FQDN (Fully Qualified Domain Name). * * An {@link IllegalArgumentException} will be thrown on failure. + * An {@link UnsupportedOperationException} will be thrown if Passpoint is not enabled + * on the device. * * @param fqdn The FQDN of the passpoint configuration to be removed */ @@ -979,6 +987,9 @@ public class WifiManager { * * An empty list will be returned when no configurations are installed. * + * An {@link UnsupportedOperationException} will be thrown if Passpoint is not enabled + * on the device. + * * @return A list of {@link PasspointConfiguration} */ public List getPasspointConfigurations() { @@ -995,6 +1006,9 @@ public class WifiManager { * {@link #EXTRA_ICON} will indicate the result of the request. * A missing intent extra {@link #EXTRA_ICON} will indicate a failure. * + * An {@link UnsupportedOperationException} will be thrown if Passpoint is not enabled + * on the device. + * * @param bssid The BSSID of the AP * @param fileName Name of the icon file (remote file) to query from the AP */