Merge "WifiManager: update docs on setWifiEnabled" into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
54233f96d7
@@ -1755,9 +1755,18 @@ public class WifiManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable Wi-Fi.
|
* 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}.
|
||||||
|
*
|
||||||
* @param enabled {@code true} to enable, {@code false} to disable.
|
* @param enabled {@code true} to enable, {@code false} to disable.
|
||||||
* @return {@code true} if the operation succeeds (or if the existing state
|
* @return {@code true} if the operation succeeds (or if the existing state
|
||||||
* is the same as the requested state).
|
* is the same as the requested state). False if wifi cannot be toggled on/off when the
|
||||||
|
* request is made.
|
||||||
*/
|
*/
|
||||||
public boolean setWifiEnabled(boolean enabled) {
|
public boolean setWifiEnabled(boolean enabled) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user