From cd3afe26d744a88ef5c52d5ecdcab0dff26001c9 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 8 Feb 2019 09:19:03 -0800 Subject: [PATCH] WifiInfo: Fix javadocs to reflect the new behavior Bug: 124080065 Test: Compiles Change-Id: Ia087d07eda30f94a79f5e1132fc3249aa0df5b32 --- wifi/java/android/net/wifi/WifiInfo.java | 33 +++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java index 488de87891787..af9fdfbd364df 100644 --- a/wifi/java/android/net/wifi/WifiInfo.java +++ b/wifi/java/android/net/wifi/WifiInfo.java @@ -276,14 +276,19 @@ public class WifiInfo implements Parcelable { /** * Returns the service set identifier (SSID) of the current 802.11 network. + *

* If the SSID can be decoded as UTF-8, it will be returned surrounded by double - * quotation marks. Otherwise, it is returned as a string of hex digits. The - * SSID may be <unknown ssid> if there is no network currently connected, - * or if the caller has insufficient permissions to access the SSID. - * + * quotation marks. Otherwise, it is returned as a string of hex digits. + * The SSID may be + * <unknown ssid>, if there is no network currently connected or if the caller has + * insufficient permissions to access the SSID. + *

+ *

* Prior to {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}, this method * always returned the SSID with no quotes around it. - * @return the SSID + *

+ * + * @return the SSID. */ public String getSSID() { if (mWifiSsid != null) { @@ -312,7 +317,13 @@ public class WifiInfo implements Parcelable { /** * Return the basic service set identifier (BSSID) of the current access point. - * The BSSID may be {@code null} if there is no network currently connected. + *

+ * The BSSID may be + * {@code null}, if there is no network currently connected. + * {@code "02:00:00:00:00:00"}, if the caller has insufficient permissions to access the + * BSSID. + *

+ * * @return the BSSID, in the form of a six-byte MAC address: {@code XX:XX:XX:XX:XX:XX} */ public String getBSSID() { @@ -511,9 +522,13 @@ public class WifiInfo implements Parcelable { /** * Each configured network has a unique small integer ID, used to identify - * the network when performing operations on the supplicant. This method - * returns the ID for the currently connected network. - * @return the network ID, or -1 if there is no currently connected network + * the network. This method returns the ID for the currently connected network. + *

+ * The networkId may be {@code -1} if there is no currently connected network or if the caller + * has insufficient permissions to access the network ID. + *

+ * + * @return the network ID. */ public int getNetworkId() { return mNetworkId;