diff options
| author | 2017-11-06 20:41:53 +0000 | |
|---|---|---|
| committer | 2017-11-06 20:41:53 +0000 | |
| commit | 9c2323199f28c19164c0be971dfbe554f039a28d (patch) | |
| tree | 5575964a38241c81da7847feb35128212b8acd74 | |
| parent | 29431f8f13785376be58499de9e10dd1b108a63c (diff) | |
| parent | ceec60bb3667398b5b0cdbe972668e6aec7206a0 (diff) | |
Merge "Clarify doc of setWifiEnabled return value"
| -rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index c2959d5e7ab7..4f3acd6ac444 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -1803,18 +1803,14 @@ public class WifiManager { /** * Enable or disable Wi-Fi. - * - * Note: This method will return false if wifi cannot be enabled (e.g., an incompatible mode - * where the user has enabled tethering or Airplane Mode). - * - * Applications need to have the {@link android.Manifest.permission#CHANGE_WIFI_STATE} - * permission to toggle wifi. Callers without the permissions will trigger a - * {@link java.lang.SecurityException}. + * <p> + * Applications must have the {@link android.Manifest.permission#CHANGE_WIFI_STATE} + * permission to toggle wifi. * * @param enabled {@code true} to enable, {@code false} to disable. - * @return {@code true} if the operation succeeds (or if the existing state - * is the same as the requested state). False if wifi cannot be toggled on/off when the - * request is made. + * @return {@code false} if the request cannot be satisfied; {@code true} indicates that wifi is + * either already in the requested state, or in progress toward the requested state. + * @throws {@link java.lang.SecurityException} if the caller is missing required permissions. */ public boolean setWifiEnabled(boolean enabled) { try { |