Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/net/wifi/WifiManager#nestedclasses) \| [Constants](https://developer.android.com/reference/android/net/wifi/WifiManager#constants) \| [Methods](https://developer.android.com/reference/android/net/wifi/WifiManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/wifi/WifiManager#inhmethods)

# WifiManager

*** ** * ** ***

` public class WifiManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.wifi.WifiManager |

<br />

*** ** * ** ***

This class provides the primary API for managing all aspects of Wi-Fi connectivity.

On releases before `https://developer.android.com/reference/android/os/Build.VERSION_CODES#N`, this object should only be obtained from an [application context](https://developer.android.com/reference/android/content/Context#getApplicationContext()), and not from any other derived context to avoid memory leaks within the calling process.

It deals with several categories of items:

- The list of configured networks. The list can be viewed and updated, and attributes of individual entries can be modified.
- The currently active Wi-Fi network, if any. Connectivity can be established or torn down, and dynamic information about the state of the network can be queried.
- Results of access point scans, containing enough information to make decisions about what access point to connect to.
- It defines the names of various Intent actions that are broadcast upon any sort of change in Wi-Fi state.

This is the API to use when performing Wi-Fi specific operations. To perform operations that pertain to network connectivity at an abstract level, use `https://developer.android.com/reference/android/net/ConnectivityManager`.
.   
Restricted for SDK Runtime environment in API level 34.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.AddNetworkResult` Provides the results of a call to `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkPrivileged(android.net.wifi.WifiConfiguration)` |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.InterfaceCreationImpact` Class describing an impact of interface creation - returned by `https://developer.android.com/reference/android/net/wifi/WifiManager#reportCreateInterfaceImpact(int,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.BiConsumer<java.lang.Boolean,java.util.Set<android.net.wifi.WifiManager.InterfaceCreationImpact>>)`. |
| ` interface` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyConnectionFailureListener` Interface for local-only connection failure listener. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback` Callback class for applications to receive updates about the LocalOnlyHotspot status. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotReservation` LocalOnlyHotspotReservation that contains the `https://developer.android.com/reference/android/net/wifi/SoftApConfiguration` for the active LocalOnlyHotspot request. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock` Allows an application to receive Wifi Multicast packets. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.ScanResultsCallback` Abstract class for scan results callback. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` Abstract callback class for applications to receive updates about the Wi-Fi subsystem restarting. |
| ` interface` | `https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionConnectionStatusListener` Interface for suggestion connection status listener. |
| ` interface` | `https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionUserApprovalStatusListener` Interface for network suggestion user approval status change listener. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock` Allows an application to keep the Wi-Fi radio awake. |
| ` interface` | `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiStateChangedListener` Listener interface for applications to be notified when the Wi-Fi enabled state changes. |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiManager.WpsCallback` *This class was deprecated in API level 28. This is deprecated* |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_PICK_WIFI_NETWORK` Activity Action: Pick a Wi-Fi network to connect to. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_DISCONNECT` If one of the removed suggestions is currently connected, trigger an immediate disconnect after suggestions removal |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_LINGER` If one of the removed suggestions is currently connected, that network will be disconnected after a short delay as opposed to immediately (which will be done by `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_DISCONNECT`). |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE` Activity Action: Show a system activity that allows the user to enable scans to be available even with Wi-Fi turned off. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION` Directed broadcast intent action indicating that the device has connected to one of the network suggestions provided by the app. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_SCAN_AVAILABILITY_CHANGED` Broadcast intent action indicating whether Wi-Fi scanning is currently available. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#CHANNEL_DATA_KEY_FREQUENCY_MHZ` The bundle key string for the channel frequency in MHz. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#CHANNEL_DATA_KEY_NUM_AP` The bundle key for the number of APs found on the corresponding channel specified by `https://developer.android.com/reference/android/net/wifi/WifiManager#CHANNEL_DATA_KEY_FREQUENCY_MHZ`. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ERROR_AUTHENTICATING` *This constant was deprecated in API level 28. This is no longer supported.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_BSSID` The lookup key for a String giving the BSSID of the access point to which we are connected. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NETWORK_INFO` The lookup key for a `https://developer.android.com/reference/android/net/NetworkInfo` object associated with the Wi-Fi network. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NETWORK_SUGGESTION` Sent as as a part of `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION` that holds an instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` corresponding to the connected network. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NEW_RSSI` The lookup key for an `int` giving the new RSSI in dBm. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NEW_STATE` *This constant was deprecated in API level 28. This is no longer supported.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_PREVIOUS_WIFI_STATE` The previous Wi-Fi state. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_RESULTS_UPDATED` Lookup key for a `boolean` extra in intent `https://developer.android.com/reference/android/net/wifi/WifiManager#SCAN_RESULTS_AVAILABLE_ACTION` representing if the scan was successful or not. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_SCAN_AVAILABLE` A boolean extra indicating whether scanning is currently available. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_SUPPLICANT_CONNECTED` *This constant was deprecated in API level 28. This is no longer supported.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_SUPPLICANT_ERROR` *This constant was deprecated in API level 28. This is no longer supported.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_WIFI_INFO` The lookup key for a `https://developer.android.com/reference/android/net/wifi/WifiInfo` object giving the information about the access point to which we are connected. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_WIFI_STATE` The lookup key for an int that indicates whether Wi-Fi is enabled, disabled, enabling, disabling, or unknown. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_OPEN` Do not send the DHCP hostname to open networks. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_SECURE` Do not send the DHCP hostname to secure network. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#NETWORK_IDS_CHANGED_ACTION` The network IDs of the configured networks could have changed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#NETWORK_STATE_CHANGED_ACTION` Broadcast intent action indicating that the state of Wi-Fi connectivity has changed. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ROAMING_MODE_AGGRESSIVE` Allows the device to roam more quickly than the normal roaming mode. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ROAMING_MODE_NONE` Roaming is disabled. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#ROAMING_MODE_NORMAL` Chipset has roaming trigger capability based on the score calculated using multiple parameters. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#RSSI_CHANGED_ACTION` The RSSI (signal strength) has changed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#SCAN_RESULTS_AVAILABLE_ACTION` An access point scan has completed, and results are available. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_ASSOCIATION` Reason code if local-only network connection attempt failed with association failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_AUTHENTICATION` Reason code if local-only network connection attempt failed with an authentication failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_IP_PROVISIONING` Reason code if local-only network connection attempt failed with an IP provisioning failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NOT_FOUND` Reason code if local-only network connection attempt failed with AP not in range. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NO_RESPONSE` Reason code if local-only network connection attempt failed with AP not responding. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_UNKNOWN` Reason code if local-only network connection attempt failed with an unknown failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_LOCAL_ONLY_CONNECTION_FAILURE_USER_REJECT` Reason code if local-only network request rejected by the user. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE` Reason code if one or more of the network suggestions added already exists in platform's database. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP` Reason code if the number of network suggestions provided by the app crosses the max threshold set per app. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID` Reason code if one or more of the network suggestions added is invalid. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED` Reason code if one or more of the network suggestions added is not allowed. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED` Reason code if the user has disallowed "android:change_wifi_state" app-ops from the app. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL` Reason code if there was an internal error in the platform while processing the addition or removal of suggestions. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID` Reason code if one or more of the network suggestions removed does not exist in platform's database. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_RESTRICTED_BY_ADMIN` Reason code if `https://developer.android.com/reference/android/os/UserManager#DISALLOW_ADD_WIFI_CONFIG` user restriction is set and calling app is restricted by device admin. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_SUCCESS` Reason code if all of the network suggestions were successfully added or removed. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_APPROVAL_APPROVED_BY_CARRIER_PRIVILEGE` Status code if the calling app was approved by virtue of being a carrier privileged app. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER` Status code if the calling app got the user approval for suggestions. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_APPROVAL_PENDING` Status code if the calling app is still pending user approval for suggestions. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_APPROVAL_REJECTED_BY_USER` Status code if the calling app suggestions were rejected by the user. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_APPROVAL_UNKNOWN` Status code if suggestion approval status is unknown, an App which hasn't made any suggestions will get this code. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION` Reason code if suggested network connection attempt failed with association failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION` Reason code if suggested network connection attempt failed with an authentication failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING` Reason code if suggested network connection attempt failed with an IP provision failure. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN` Reason code if suggested network connection attempt failed with an unknown failure. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#SUPPLICANT_CONNECTION_CHANGE_ACTION` *This constant was deprecated in API level 28. This is no longer supported.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#SUPPLICANT_STATE_CHANGED_ACTION` *This constant was deprecated in API level 28. This is no longer supported.* |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#UNKNOWN_SSID` Indicates an invalid SSID. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_AP` Wi-Fi interface of type AP (access point Wi-Fi infrastructure device). |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_AWARE` Wi-Fi interface of type Wi-Fi Aware (aka NAN). |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_DIRECT` Wi-Fi interface of type Wi-Fi Direct (aka P2P). |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_STA` Wi-Fi interface of type STA (station/client Wi-Fi infrastructure device). |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL` *This constant was deprecated in API level 29. This API is non-functional and will have no impact.* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF` *This constant was deprecated in API level 34. The `WIFI_MODE_FULL_HIGH_PERF` is deprecated and is automatically replaced with `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` with all the restrictions documented on that lock. I.e. any request to the `WIFI_MODE_FULL_HIGH_PERF` will now obtain a `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` lock instead. Deprecation is due to the impact of `WIFI_MODE_FULL_HIGH_PERF` on power dissipation. The `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` provides much of the same desired functionality with less impact on power dissipation.* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` In this Wi-Fi lock mode, Wi-Fi will operate with a priority to achieve low latency. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_SCAN_ONLY` *This constant was deprecated in API level 29. This API is non-functional and will have no impact.* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_DBS_AP` Wi-Fi simultaneous connection to multiple internet-providing Wi-FI networks (APs) is enabled and restricted to a single network on different bands (e.g. a DBS AP). |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_DISABLED` Wi-Fi simultaneous connection to multiple internet-providing Wi-Fi networks (APs) is disabled. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_MULTI_AP` Wi-Fi simultaneous connection to multiple internet-providing Wi-Fi networks (APs) is enabled. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_CHANGED_ACTION` Broadcast intent action indicating that Wi-Fi has been enabled, disabled, enabling, disabling, or unknown. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLED` Wi-Fi is disabled. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLING` Wi-Fi is currently being disabled. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLED` Wi-Fi is enabled. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLING` Wi-Fi is currently being enabled. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_UNKNOWN` Wi-Fi is in an unknown state. |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WPS_AUTH_FAILURE` *This constant was deprecated in API level 28. This is deprecated* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WPS_OVERLAP_ERROR` *This constant was deprecated in API level 28. This is deprecated* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WPS_TIMED_OUT` *This constant was deprecated in API level 28. This is deprecated* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WPS_TKIP_ONLY_PROHIBITED` *This constant was deprecated in API level 28. This is deprecated* |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiManager#WPS_WEP_PROHIBITED` *This constant was deprecated in API level 28. This is deprecated* |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addLocalOnlyConnectionFailureListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyConnectionFailureListener listener) ` Add a listener for local-only networks. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)(https://developer.android.com/reference/android/net/wifi/WifiConfiguration config) ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `-1`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` https://developer.android.com/reference/android/net/wifi/WifiManager.AddNetworkResult` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkPrivileged(android.net.wifi.WifiConfiguration)(https://developer.android.com/reference/android/net/wifi/WifiConfiguration config) ` This is a new version of `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)` which returns more detailed failure codes. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion> networkSuggestions) ` Provide a list of network suggestions to the device. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addOrUpdatePasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration)(https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration config) ` Add or update a Passpoint configuration. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addSuggestionConnectionStatusListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SuggestionConnectionStatusListener)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionConnectionStatusListener listener) ` Add a listener for suggestion networks. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addSuggestionUserApprovalStatusListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionUserApprovalStatusListener listener) ` Add a listener for Wi-Fi network suggestion user approval status. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#addWifiStateChangedListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.WifiStateChangedListener)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.WifiStateChangedListener listener) ` Register a callback for Wi-Fi state. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#allowAutojoinGlobal(boolean)(boolean allowAutojoin) ` Control whether the device will automatically search for and connect to Wi-Fi networks - auto-join Wi-Fi networks. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#calculateSignalLevel(int)(int rssi) ` Given a raw RSSI, return the RSSI signal quality rating using the system default RSSI quality rating thresholds. |
| ` static int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#calculateSignalLevel(int,%20int)(int rssi, int numLevels) ` *This method was deprecated in API level 30. Callers should use `https://developer.android.com/reference/android/net/wifi/WifiManager#calculateSignalLevel(int)` instead to get the signal level using the system default RSSI thresholds, or otherwise compute the RSSI level themselves using their own formula.* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#cancelWps(android.net.wifi.WifiManager.WpsCallback)(https://developer.android.com/reference/android/net/wifi/WifiManager.WpsCallback listener) ` *This method was deprecated in API level 28. This API is deprecated* |
| ` static int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#compareSignalLevel(int,%20int)(int rssiA, int rssiB) ` Compares two signal strengths. |
| ` https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#createMulticastLock(java.lang.String)(https://developer.android.com/reference/java/lang/String tag) ` Create a new MulticastLock |
| ` https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#createWifiLock(java.lang.String)(https://developer.android.com/reference/java/lang/String tag) ` *This method was deprecated in API level 29. This API is non-functional.* |
| ` https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#createWifiLock(int,%20java.lang.String)(int lockType, https://developer.android.com/reference/java/lang/String tag) ` Creates a new WifiLock. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#disableNetwork(int)(int netId) ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#disallowCurrentSuggestedNetwork(android.net.wifi.BlockingOption)(https://developer.android.com/reference/android/net/wifi/BlockingOption blockingOption) ` When the device is connected to a network suggested by calling app `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, this API provide a way to avoid the current connection without `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#disconnect()() ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#enableNetwork(int,%20boolean)(int netId, boolean attemptConnect) ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#flushPasspointAnqpCache()() ` Flush Passpoint ANQP cache, and clear pending ANQP requests. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getAllowedChannels(int,%20int)(int band, int mode) ` Returns a list of `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel` for the specified band and operational mode(s), that is allowed for the current regulatory domain. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiConfiguration>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getCallerConfiguredNetworks()() ` Return a list of all the networks previously configured by the calling app. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getChannelData(java.util.concurrent.Executor,%20java.util.function.Consumer<java.util.List<android.os.Bundle>>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/os/Bundle>> resultsCallback) ` Get channel data such as the number of APs found on each channel from the most recent scan. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiConfiguration>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getConfiguredNetworks()() ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return an empty list.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps will have access to the full list. - Callers with Carrier privilege will receive a restricted list only containing configurations which they created.* <br /> |
| ` https://developer.android.com/reference/android/net/wifi/WifiInfo` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getConnectionInfo()() ` *This method was deprecated in API level 31. Starting with `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`, WifiInfo retrieval is moved to `https://developer.android.com/reference/android/net/ConnectivityManager` API surface. WifiInfo is attached in `https://developer.android.com/reference/android/net/NetworkCapabilities#getTransportInfo()` which is available via callback in `https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback#onCapabilitiesChanged(android.net.Network,%20android.net.NetworkCapabilities)` or on-demand from `https://developer.android.com/reference/android/net/ConnectivityManager#getNetworkCapabilities(android.net.Network)`.* *Usage example: ``` final NetworkRequest request = new NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) .build(); final ConnectivityManager connectivityManager = context.getSystemService(ConnectivityManager.class); final NetworkCallback networkCallback = new NetworkCallback() { ... @Override void onAvailable(Network network) {} @Override void onCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities) { WifiInfo wifiInfo = (WifiInfo) networkCapabilities.getTransportInfo(); } // etc. }; connectivityManager.requestNetwork(request, networkCallback); // For request connectivityManager.registerNetworkCallback(request, networkCallback); // For listen ``` **Compatibility Notes:** - Apps can continue using this API, however newer features such as ability to mask out location sensitive data in WifiInfo will not be supported via this API. - On devices supporting concurrent connections (indicated via `https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForLocalOnlyConnectionsSupported()`, etc) this API will return the details of the internet providing connection (if any) to all apps, except for the apps that triggered the creation of the concurrent connection. For such apps, this API will return the details of the connection they created. e.g. apps using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier` will trigger a concurrent connection on supported devices and hence this API will provide details of their peer to peer connection (not the internet providing connection). This is to maintain backwards compatibility with behavior on single STA devices.* <br /> |
| ` https://developer.android.com/reference/android/net/DhcpInfo` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getDhcpInfo()() ` *This method was deprecated in API level 31. Use the methods on `https://developer.android.com/reference/android/net/LinkProperties` which can be obtained either via `https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback#onLinkPropertiesChanged(android.net.Network,%20android.net.LinkProperties)` or `https://developer.android.com/reference/android/net/ConnectivityManager#getLinkProperties(android.net.Network)`.* ***Compatibility Notes:*** - *On devices supporting concurrent connections (indicated via `https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForLocalOnlyConnectionsSupported()`, etc), this API will return the details of the internet providing connection (if any) to all apps, except for the apps that triggered the creation of the concurrent connection. For such apps, this API will return the details of the connection they created. e.g. apps using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier` will trigger a concurrent connection on supported devices and hence this API will provide details of their peer to peer connection (not the internet providing connection). This is to maintain backwards compatibility with behavior on single STA devices.* *<br />* |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxNumberOfChannelsPerNetworkSpecifierRequest()() ` Returns the max number of channels that is allowed to be set on a `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier`. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxNumberOfNetworkSuggestionsPerApp()() ` Returns the max number of network suggestions that are allowed per app on the device. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxSignalLevel()() ` Get the system default maximum signal level. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxSupportedConcurrentTdlsSessions(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Integer>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/lang/Integer> resultsCallback) ` Return the maximum number of concurrent TDLS sessions supported by the device. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getNetworkSuggestions()() ` Get all network suggestions provided by the calling app. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getNumberOfEnabledTdlsSessions(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Integer>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/lang/Integer> resultsCallback) ` Return the number of currently enabled TDLS sessions. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getPasspointConfigurations()() ` *This method was deprecated in API level 29. This will be non-functional in a future release. Requires `android.Manifest.permission.NETWORK_SETTINGS` or `android.Manifest.permission.NETWORK_SETUP_WIZARD`.* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getPerSsidRoamingModes(java.util.concurrent.Executor,%20java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Integer>>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/java/lang/Integer>> resultsCallback) ` This API allows a privileged application to get roaming mode policies configured using the `https://developer.android.com/reference/android/net/wifi/WifiManager#setPerSsidRoamingMode(android.net.wifi.WifiSsid,%20int)`. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/ScanResult>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getScanResults()() ` Return the results of the latest access point scan. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getStaConcurrencyForMultiInternetMode()() ` The device may support concurrent connections to multiple internet-providing Wi-Fi networks (APs) - that is indicated by `https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForMultiInternetSupported()`. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel>` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getUsableChannels(int,%20int)(int band, int mode) ` Returns a list of `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel` for the specified band and operational mode(s) per the current regulatory domain and device-specific constraints such as concurrency state and interference due to other radios. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()() ` Gets the Wi-Fi enabled state. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#is24GHzBandSupported()() ` Check if the chipset supports 2.4GHz band. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#is5GHzBandSupported()() ` Check if the chipset supports 5GHz band. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#is60GHzBandSupported()() ` Check if the chipset supports the 60GHz frequency band. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#is6GHzBandSupported()() ` Check if the chipset supports 6GHz band. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isAggressiveRoamingModeSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isAutoWakeupEnabled()() ` Get the persisted Wi-Fi auto wakeup feature state. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isBridgedApConcurrencySupported()() ` Query whether or not the device supports multiple Access point (AP) which are bridged together. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isCarrierNetworkOffloadEnabled(int,%20boolean)(int subscriptionId, boolean merged) ` Get the carrier network offload state for merged or unmerged networks for specified subscription. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isD2dSupportedWhenInfraStaDisabled()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isDecoratedIdentitySupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isDeviceToApRttSupported()() ` *This method was deprecated in API level 29. Please use `https://developer.android.com/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String)` with `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_WIFI_RTT`.* |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isDualBandSimultaneousSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isEasyConnectDppAkmSupported()() ` Wi-Fi Easy Connect DPP AKM enables provisioning and configuration of Wi-Fi devices without the need of using the device PSK passphrase. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isEasyConnectEnrolleeResponderModeSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isEasyConnectSupported()() ` Wi-Fi Easy Connect (DPP) introduces standardized mechanisms to simplify the provisioning and configuration of Wi-Fi devices. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isEnhancedOpenSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isEnhancedPowerReportingSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isMakeBeforeBreakWifiSwitchingSupported()() ` Query whether or not the device supports concurrent station (STA) connections for make-before-break wifi to wifi switching. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isP2pSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isPasspointTermsAndConditionsSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isPreferredNetworkOffloadSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isScanAlwaysAvailable()() ` *This method was deprecated in API level 29. The ability for apps to trigger scan requests will be removed in a future release.* |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isScanThrottleEnabled()() ` Get the persisted Wi-Fi scan throttle state. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isStaApConcurrencySupported()() ` Query whether or not the device supports Station (STA) + Access point (AP) concurrency. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isStaBridgedApConcurrencySupported()() ` Query whether or not the device supports concurrency of Station (STA) + multiple access points (AP) (where the APs bridged together). |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForLocalOnlyConnectionsSupported()() ` Query whether or not the device supports concurrent station (STA) connections for local-only connections using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier`. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForMultiInternetSupported()() ` Query whether or not the device supports concurrent station (STA) connections for multi internet connections. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isTdlsOperationCurrentlyAvailable(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/lang/Boolean> resultsCallback) ` Check if a TDLS session can be established at this time via `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)` Internally framework checks the STA connected state, device support for TDLS and the number of TDLS sessions available in driver/firmware. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isTdlsSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isTidToLinkMappingNegotiationSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isTlsMinimumVersionSupported()() ` Indicate that whether or not settings required TLS minimum version is supported. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isTlsV13Supported()() ` Indicate that whether or not TLS v1.3 is supported. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isTrustOnFirstUseSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWapiSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWepSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiDisplayR2Supported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiEnabled()() ` Return whether Wi-Fi is enabled or disabled. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiPasspointEnabled()() ` If the device supports Wi-Fi Passpoint, the user can explicitly enable or disable it. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiStandardSupported(int)(int standard) ` Check if the chipset supports a certain Wi-Fi standard. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWpa3SaeH2eSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWpa3SaePublicKeySupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWpa3SaeSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWpa3SuiteBSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#isWpaPersonalSupported()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#pingSupplicant()() ` *This method was deprecated in API level 26. Will return the output of `https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiEnabled()` instead.* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#queryAutojoinGlobal(java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/lang/Boolean> resultsCallback) ` Query whether or not auto-join global is enabled/disabled |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#querySendDhcpHostnameRestriction(java.util.concurrent.Executor,%20java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/IntConsumer resultsCallback) ` Query the global restriction on which networks to send the device hostname to during DHCP. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#reassociate()() ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always return false.* |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#reconnect()() ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#registerScanResultsCallback(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.ScanResultsCallback)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.ScanResultsCallback callback) ` Register a callback for Scan Results. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#registerSubsystemRestartTrackingCallback(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SubsystemRestartTrackingCallback)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback callback) ` Registers a `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` to listen to Wi-Fi subsystem restarts. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeLocalOnlyConnectionFailureListener(android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener)(https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyConnectionFailureListener listener) ` Allow callers to remove a previously registered listener. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetwork(int)(int netId) ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion> networkSuggestions, int action) ` Remove some or all of the network suggestions that were previously provided by the app. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion> networkSuggestions) ` Remove some or all of the network suggestions that were previously provided by the app. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeNonCallerConfiguredNetworks()() ` Remove all configured networks that were not created by the calling app. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removePasspointConfiguration(java.lang.String)(https://developer.android.com/reference/java/lang/String fqdn) ` *This method was deprecated in API level 29. This will be non-functional in a future release. Requires `android.Manifest.permission.NETWORK_SETTINGS` or `android.Manifest.permission.NETWORK_CARRIER_PROVISIONING`.* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removePerSsidRoamingMode(android.net.wifi.WifiSsid)(https://developer.android.com/reference/android/net/wifi/WifiSsid ssid) ` This API allows a privileged application to remove roaming mode policy configured using the `https://developer.android.com/reference/android/net/wifi/WifiManager#setPerSsidRoamingMode(android.net.wifi.WifiSsid,%20int)`. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeSuggestionConnectionStatusListener(android.net.wifi.WifiManager.SuggestionConnectionStatusListener)(https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionConnectionStatusListener listener) ` Allow callers to remove a previously registered listener. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeSuggestionUserApprovalStatusListener(android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener)(https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionUserApprovalStatusListener listener) ` Allow callers to remove a previously registered listener using `https://developer.android.com/reference/android/net/wifi/WifiManager#addSuggestionUserApprovalStatusListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener)`. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#removeWifiStateChangedListener(android.net.wifi.WifiManager.WifiStateChangedListener)(https://developer.android.com/reference/android/net/wifi/WifiManager.WifiStateChangedListener listener) ` Unregisters a WifiStateChangedListener from listening on the current Wi-Fi state. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#reportCreateInterfaceImpact(int,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.BiConsumer<java.lang.Boolean,java.util.Set<android.net.wifi.WifiManager.InterfaceCreationImpact>>)(int interfaceType, boolean requireNewInterface, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/BiConsumer<https://developer.android.com/reference/java/lang/Boolean, https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/net/wifi/WifiManager.InterfaceCreationImpact>> resultCallback) ` Queries the framework to determine whether the specified interface can be created, and if so - what other interfaces would be torn down by the framework to allow this creation if it were requested. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#saveConfiguration()() ` *This method was deprecated in API level 26. There is no need to call this method - `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#updateNetwork(android.net.wifi.WifiConfiguration)` and `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetwork(int)` already persist the configurations automatically.* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setPerSsidRoamingMode(android.net.wifi.WifiSsid,%20int)(https://developer.android.com/reference/android/net/wifi/WifiSsid ssid, int roamingMode) ` This API allows a privileged application to set roaming mode per SSID. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setSendDhcpHostnameRestriction(int)(int restriction) ` Sets the global restrictions on which networks to send the device hostname to during DHCP. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)(https://developer.android.com/reference/java/net/InetAddress remoteIPAddress, boolean enable) ` Enable/Disable TDLS on a specific local route. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)(https://developer.android.com/reference/java/net/InetAddress remoteIPAddress, boolean enable, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/lang/Boolean> resultsCallback) ` Enable/Disable TDLS on a specific local route. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)(https://developer.android.com/reference/java/lang/String remoteMacAddress, boolean enable, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/java/lang/Boolean> resultsCallback) ` Enable/Disable TDLS with a specific peer Mac Address. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean)(https://developer.android.com/reference/java/lang/String remoteMacAddress, boolean enable) ` Similar to `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)`, except this version allows you to specify remote endpoint with a MAC address. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#setWifiEnabled(boolean)(boolean enabled) ` *This method was deprecated in API level 29. Starting with Build.VERSION_CODES#Q, applications are not allowed to enable/disable Wi-Fi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`. If apps are targeting an older SDK (`https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` or below), they can continue to use this API.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* *Starting with `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, DO and a profile owner of an organization owned device may set a user restriction (DISALLOW_CHANGE_WIFI_STATE) to only allow DO/PO to use this API.* <br /> |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)(https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback callback, https://developer.android.com/reference/android/os/Handler handler) ` Request a local only hotspot that an application can use to communicate between co-located devices connected to the created WiFi hotspot. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspotWithConfiguration(android.net.wifi.SoftApConfiguration,%20java.util.concurrent.Executor,%20android.net.wifi.WifiManager.LocalOnlyHotspotCallback)(https://developer.android.com/reference/android/net/wifi/SoftApConfiguration config, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback callback) ` Starts a local-only hotspot with a specific configuration applied. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#startScan()() ` *This method was deprecated in API level 28. The ability for apps to trigger scan requests will be removed in a future release.* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#startWps(android.net.wifi.WpsInfo,%20android.net.wifi.WifiManager.WpsCallback)(https://developer.android.com/reference/android/net/wifi/WpsInfo config, https://developer.android.com/reference/android/net/wifi/WifiManager.WpsCallback listener) ` *This method was deprecated in API level 28. This API is deprecated* |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#unregisterScanResultsCallback(android.net.wifi.WifiManager.ScanResultsCallback)(https://developer.android.com/reference/android/net/wifi/WifiManager.ScanResultsCallback callback) ` Allow callers to unregister a previously registered callback. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#unregisterSubsystemRestartTrackingCallback(android.net.wifi.WifiManager.SubsystemRestartTrackingCallback)(https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback callback) ` Unregisters a `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` registered with `https://developer.android.com/reference/android/net/wifi/WifiManager#registerSubsystemRestartTrackingCallback(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SubsystemRestartTrackingCallback)` Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE` |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#updateNetwork(android.net.wifi.WifiConfiguration)(https://developer.android.com/reference/android/net/wifi/WifiConfiguration config) ` *This method was deprecated in API level 29. a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `-1`.* *Deprecation Exemptions:* *- Device Owner (DO), Profile Owner (PO) and system apps.* <br /> |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiManager#validateSoftApConfiguration(android.net.wifi.SoftApConfiguration)(https://developer.android.com/reference/android/net/wifi/SoftApConfiguration config) ` Check if input configuration is valid. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ACTION_PICK_WIFI_NETWORK

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_PICK_WIFI_NETWORK
```

Activity Action: Pick a Wi-Fi network to connect to.

Input: Nothing.

Output: Nothing.

<br />

Constant Value: "android.net.wifi.PICK_WIFI_NETWORK"

### ACTION_REMOVE_SUGGESTION_DISCONNECT

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACTION_REMOVE_SUGGESTION_DISCONNECT
```

If one of the removed suggestions is currently connected, trigger an immediate disconnect after suggestions removal

<br />

Constant Value: 2 (0x00000002)

### ACTION_REMOVE_SUGGESTION_LINGER

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ACTION_REMOVE_SUGGESTION_LINGER
```

If one of the removed suggestions is currently connected, that network will be disconnected after a short delay as opposed to immediately (which will be done by `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_DISCONNECT`). The `https://developer.android.com/reference/android/net/ConnectivityManager` may call the `https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback#onLosing(android.net.Network,%20int)` on such networks.

<br />

Constant Value: 1 (0x00000001)

### ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE
```

Activity Action: Show a system activity that allows the user to enable scans to be available even with Wi-Fi turned off.

Notification of the result of this activity is posted using the `https://developer.android.com/reference/android/app/Activity#onActivityResult(int,%20int,%20android.content.Intent)` callback. The `resultCode` will be `https://developer.android.com/reference/android/app/Activity#RESULT_OK` if scan always mode has been turned on or `https://developer.android.com/reference/android/app/Activity#RESULT_CANCELED` if the user has rejected the request or an error has occurred.

<br />

Constant Value: "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE"

### ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION
```

Directed broadcast intent action indicating that the device has connected to one of the network suggestions provided by the app. This will be sent post connection to a network which was created with `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsAppInteractionRequired(boolean)` flag set.

Note: The broadcast is sent to the app only if it holds `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` permission.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NETWORK_SUGGESTION`

Constant Value: "android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION"

### ACTION_WIFI_SCAN_AVAILABILITY_CHANGED

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_WIFI_SCAN_AVAILABILITY_CHANGED
```

Broadcast intent action indicating whether Wi-Fi scanning is currently available. Available extras: - `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_SCAN_AVAILABLE`

<br />

Constant Value: "android.net.wifi.action.WIFI_SCAN_AVAILABILITY_CHANGED"

### CHANNEL_DATA_KEY_FREQUENCY_MHZ

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String CHANNEL_DATA_KEY_FREQUENCY_MHZ
```

The bundle key string for the channel frequency in MHz. See `https://developer.android.com/reference/android/net/wifi/WifiManager#getChannelData(java.util.concurrent.Executor,%20java.util.function.Consumer<java.util.List<android.os.Bundle>>)`

<br />

Constant Value: "CHANNEL_DATA_KEY_FREQUENCY_MHZ"

### CHANNEL_DATA_KEY_NUM_AP

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String CHANNEL_DATA_KEY_NUM_AP
```

The bundle key for the number of APs found on the corresponding channel specified by `https://developer.android.com/reference/android/net/wifi/WifiManager#CHANNEL_DATA_KEY_FREQUENCY_MHZ`. See `https://developer.android.com/reference/android/net/wifi/WifiManager#getChannelData(java.util.concurrent.Executor,%20java.util.function.Consumer<java.util.List<android.os.Bundle>>)`

<br />

Constant Value: "CHANNEL_DATA_KEY_NUM_AP"

### ERROR_AUTHENTICATING

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_AUTHENTICATING
```

<br />

**This constant was deprecated in API level 28.**   

This is no longer supported.

The error code if there was a problem authenticating.

<br />

Constant Value: 1 (0x00000001)

### EXTRA_BSSID

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_BSSID
```

The lookup key for a String giving the BSSID of the access point to which we are connected. No longer used.

<br />

Constant Value: "bssid"

### EXTRA_NETWORK_INFO

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_NETWORK_INFO
```

The lookup key for a `https://developer.android.com/reference/android/net/NetworkInfo` object associated with the Wi-Fi network. Retrieve with `https://developer.android.com/reference/android/content/Intent#getParcelableExtra(java.lang.String)`.

<br />

Constant Value: "networkInfo"

### EXTRA_NETWORK_SUGGESTION

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_NETWORK_SUGGESTION
```

Sent as as a part of `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION` that holds an instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` corresponding to the connected network.

<br />

Constant Value: "android.net.wifi.extra.NETWORK_SUGGESTION"

### EXTRA_NEW_RSSI

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_NEW_RSSI
```

The lookup key for an `int` giving the new RSSI in dBm.

<br />

Constant Value: "newRssi"

### EXTRA_NEW_STATE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_NEW_STATE
```

<br />

**This constant was deprecated in API level 28.**   

This is no longer supported.

The lookup key for a `https://developer.android.com/reference/android/net/wifi/SupplicantState` describing the new state Retrieve with `https://developer.android.com/reference/android/content/Intent#getParcelableExtra(java.lang.String)`.

<br />

Constant Value: "newState"

### EXTRA_PREVIOUS_WIFI_STATE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PREVIOUS_WIFI_STATE
```

The previous Wi-Fi state.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_WIFI_STATE`

Constant Value: "previous_wifi_state"

### EXTRA_RESULTS_UPDATED

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_RESULTS_UPDATED
```

Lookup key for a `boolean` extra in intent `https://developer.android.com/reference/android/net/wifi/WifiManager#SCAN_RESULTS_AVAILABLE_ACTION` representing if the scan was successful or not. Scans may fail for multiple reasons, these may include:

1. An app requested too many scans in a certain period of time. This may lead to additional scan request rejections via "scan throttling" for both foreground and background apps. Note: Apps holding android.Manifest.permission.NETWORK_SETTINGS permission are exempted from scan throttling.
2. The device is idle and scanning is disabled.
3. Wifi hardware reported a scan failure.

<br />

<br />

Constant Value: "resultsUpdated"

### EXTRA_SCAN_AVAILABLE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_SCAN_AVAILABLE
```

A boolean extra indicating whether scanning is currently available. Sent in the broadcast `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_SCAN_AVAILABILITY_CHANGED`. Its value is true if scanning is currently available, false otherwise.

<br />

Constant Value: "android.net.wifi.extra.SCAN_AVAILABLE"

### EXTRA_SUPPLICANT_CONNECTED

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_SUPPLICANT_CONNECTED
```

<br />

**This constant was deprecated in API level 28.**   

This is no longer supported.

The lookup key for a boolean that indicates whether a connection to the supplicant daemon has been gained or lost. `true` means a connection now exists. Retrieve it with `https://developer.android.com/reference/android/content/Intent#getBooleanExtra(java.lang.String,%20boolean)`.

<br />

Constant Value: "connected"

### EXTRA_SUPPLICANT_ERROR

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_SUPPLICANT_ERROR
```

<br />

**This constant was deprecated in API level 28.**   

This is no longer supported.

The lookup key for a `https://developer.android.com/reference/android/net/wifi/SupplicantState` describing the supplicant error code if any Retrieve with `https://developer.android.com/reference/android/content/Intent#getIntExtra(java.lang.String,%20int)`.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#ERROR_AUTHENTICATING`

Constant Value: "supplicantError"

### EXTRA_WIFI_INFO

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_WIFI_INFO
```

The lookup key for a `https://developer.android.com/reference/android/net/wifi/WifiInfo` object giving the information about the access point to which we are connected. No longer used.

<br />

Constant Value: "wifiInfo"

### EXTRA_WIFI_STATE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_WIFI_STATE
```

The lookup key for an int that indicates whether Wi-Fi is enabled, disabled, enabling, disabling, or unknown. Retrieve it with `https://developer.android.com/reference/android/content/Intent#getIntExtra(java.lang.String,%20int)`.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLED`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLING`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLED`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLING`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_UNKNOWN`

Constant Value: "wifi_state"

### FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_OPEN

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_OPEN
```

Do not send the DHCP hostname to open networks.

<br />

Constant Value: 1 (0x00000001)

### FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_SECURE

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_SECURE
```

Do not send the DHCP hostname to secure network.

<br />

Constant Value: 2 (0x00000002)

### NETWORK_IDS_CHANGED_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NETWORK_IDS_CHANGED_ACTION
```

The network IDs of the configured networks could have changed.

<br />

Constant Value: "android.net.wifi.NETWORK_IDS_CHANGED"

### NETWORK_STATE_CHANGED_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NETWORK_STATE_CHANGED_ACTION
```

Broadcast intent action indicating that the state of Wi-Fi connectivity has changed. An extra provides the new state in the form of a `https://developer.android.com/reference/android/net/NetworkInfo` object. No network-related permissions are required to subscribe to this broadcast.

This broadcast is not delivered to manifest receivers in applications that target API version 26 or later.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NETWORK_INFO`

Constant Value: "android.net.wifi.STATE_CHANGE"

### ROAMING_MODE_AGGRESSIVE

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ROAMING_MODE_AGGRESSIVE
```

Allows the device to roam more quickly than the normal roaming mode. Used in cases such as where APs are installed in a high density.

<br />

Constant Value: 2 (0x00000002)

### ROAMING_MODE_NONE

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ROAMING_MODE_NONE
```

Roaming is disabled.

<br />

Constant Value: 0 (0x00000000)

### ROAMING_MODE_NORMAL

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ROAMING_MODE_NORMAL
```

Chipset has roaming trigger capability based on the score calculated using multiple parameters. If device is configured to this mode then it will be using chipset's normal (default) roaming.

<br />

Constant Value: 1 (0x00000001)

### RSSI_CHANGED_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String RSSI_CHANGED_ACTION
```

The RSSI (signal strength) has changed. Receiver Required Permission: android.Manifest.permission.ACCESS_WIFI_STATE

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NEW_RSSI`

Constant Value: "android.net.wifi.RSSI_CHANGED"

### SCAN_RESULTS_AVAILABLE_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String SCAN_RESULTS_AVAILABLE_ACTION
```

An access point scan has completed, and results are available. Call `https://developer.android.com/reference/android/net/wifi/WifiManager#getScanResults()` to obtain the results. The broadcast intent may contain an extra field with the key `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_RESULTS_UPDATED` and a `boolean` value indicating if the scan was successful.

<br />

Constant Value: "android.net.wifi.SCAN_RESULTS"

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_ASSOCIATION

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_ASSOCIATION
```

Reason code if local-only network connection attempt failed with association failure.

<br />

Constant Value: 1 (0x00000001)

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_AUTHENTICATION

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_AUTHENTICATION
```

Reason code if local-only network connection attempt failed with an authentication failure.

<br />

Constant Value: 2 (0x00000002)

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_IP_PROVISIONING

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_IP_PROVISIONING
```

Reason code if local-only network connection attempt failed with an IP provisioning failure.

<br />

Constant Value: 3 (0x00000003)

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NOT_FOUND

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NOT_FOUND
```

Reason code if local-only network connection attempt failed with AP not in range.

<br />

Constant Value: 4 (0x00000004)

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NO_RESPONSE

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_NO_RESPONSE
```

Reason code if local-only network connection attempt failed with AP not responding.

<br />

Constant Value: 5 (0x00000005)

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_UNKNOWN

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_UNKNOWN
```

Reason code if local-only network connection attempt failed with an unknown failure.

<br />

Constant Value: 0 (0x00000000)

### STATUS_LOCAL_ONLY_CONNECTION_FAILURE_USER_REJECT

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_LOCAL_ONLY_CONNECTION_FAILURE_USER_REJECT
```

Reason code if local-only network request rejected by the user.

<br />

Constant Value: 6 (0x00000006)

### STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE
```

Reason code if one or more of the network suggestions added already exists in platform's database. Note: this code will not be returned with Android 11 as in-place modification is allowed, please check `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#equals(java.lang.Object)`

Constant Value: 3 (0x00000003)

### STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP
```

Reason code if the number of network suggestions provided by the app crosses the max threshold set per app. The framework will reject all suggestions provided by `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` if the total size exceeds the limit.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxNumberOfNetworkSuggestionsPerApp()`

Constant Value: 4 (0x00000004)

### STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID
```

Reason code if one or more of the network suggestions added is invalid. Framework will reject all the suggestions in the list. The framework will reject all suggestions provided by `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` if one or more of them is invalid. Please use `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to create network suggestions.

<br />

Constant Value: 7 (0x00000007)

### STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED
```

Reason code if one or more of the network suggestions added is not allowed. The framework will reject all suggestions provided by `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` if one or more of them is not allowed. This error may be caused by suggestion is using SIM-based encryption method, but calling app is not carrier privileged.

<br />

Constant Value: 6 (0x00000006)

### STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED
```

Reason code if the user has disallowed "android:change_wifi_state" app-ops from the app.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/AppOpsManager#unsafeCheckOp(java.lang.String,%20int,%20java.lang.String)`

Constant Value: 2 (0x00000002)

### STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL
```

Reason code if there was an internal error in the platform while processing the addition or removal of suggestions.

<br />

Constant Value: 1 (0x00000001)

### STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID
```

Reason code if one or more of the network suggestions removed does not exist in platform's database. The framework won't remove any suggestions if one or more of suggestions provided by `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` does not exist in database.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#equals(java.lang.Object)`

Constant Value: 5 (0x00000005)

### STATUS_NETWORK_SUGGESTIONS_ERROR_RESTRICTED_BY_ADMIN

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_ERROR_RESTRICTED_BY_ADMIN
```

Reason code if `https://developer.android.com/reference/android/os/UserManager#DISALLOW_ADD_WIFI_CONFIG` user restriction is set and calling app is restricted by device admin.

<br />

Constant Value: 8 (0x00000008)

### STATUS_NETWORK_SUGGESTIONS_SUCCESS

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_NETWORK_SUGGESTIONS_SUCCESS
```

Reason code if all of the network suggestions were successfully added or removed.

<br />

Constant Value: 0 (0x00000000)

### STATUS_SUGGESTION_APPROVAL_APPROVED_BY_CARRIER_PRIVILEGE

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_APPROVAL_APPROVED_BY_CARRIER_PRIVILEGE
```

Status code if the calling app was approved by virtue of being a carrier privileged app.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`

Constant Value: 4 (0x00000004)

### STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_APPROVAL_APPROVED_BY_USER
```

Status code if the calling app got the user approval for suggestions.

<br />

Constant Value: 2 (0x00000002)

### STATUS_SUGGESTION_APPROVAL_PENDING

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_APPROVAL_PENDING
```

Status code if the calling app is still pending user approval for suggestions.

<br />

Constant Value: 1 (0x00000001)

### STATUS_SUGGESTION_APPROVAL_REJECTED_BY_USER

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_APPROVAL_REJECTED_BY_USER
```

Status code if the calling app suggestions were rejected by the user.

<br />

Constant Value: 3 (0x00000003)

### STATUS_SUGGESTION_APPROVAL_UNKNOWN

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_APPROVAL_UNKNOWN
```

Status code if suggestion approval status is unknown, an App which hasn't made any suggestions will get this code.

<br />

Constant Value: 0 (0x00000000)

### STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION
```

Reason code if suggested network connection attempt failed with association failure.

<br />

Constant Value: 1 (0x00000001)

### STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION
```

Reason code if suggested network connection attempt failed with an authentication failure.

<br />

Constant Value: 2 (0x00000002)

### STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING
```

Reason code if suggested network connection attempt failed with an IP provision failure.

<br />

Constant Value: 3 (0x00000003)

### STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN
```

Reason code if suggested network connection attempt failed with an unknown failure.

<br />

Constant Value: 0 (0x00000000)

### SUPPLICANT_CONNECTION_CHANGE_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String SUPPLICANT_CONNECTION_CHANGE_ACTION
```

<br />

**This constant was deprecated in API level 28.**   

This is no longer supported.

Broadcast intent action indicating that a connection to the supplicant has been established (and it is now possible to perform Wi-Fi operations) or the connection to the supplicant has been lost. One extra provides the connection state as a boolean, where `true` means CONNECTED.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_SUPPLICANT_CONNECTED`

Constant Value: "android.net.wifi.supplicant.CONNECTION_CHANGE"

### SUPPLICANT_STATE_CHANGED_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String SUPPLICANT_STATE_CHANGED_ACTION
```

<br />

**This constant was deprecated in API level 28.**   

This is no longer supported.

Broadcast intent action indicating that the state of establishing a connection to an access point has changed.One extra provides the new `https://developer.android.com/reference/android/net/wifi/SupplicantState`. Note that the supplicant state is Wi-Fi specific, and is not generally the most useful thing to look at if you are just interested in the overall state of connectivity.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_NEW_STATE`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_SUPPLICANT_ERROR`

Constant Value: "android.net.wifi.supplicant.STATE_CHANGE"

### UNKNOWN_SSID

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String UNKNOWN_SSID
```

Indicates an invalid SSID.

<br />

Constant Value: " "

### WIFI_INTERFACE_TYPE_AP

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_INTERFACE_TYPE_AP
```

Wi-Fi interface of type AP (access point Wi-Fi infrastructure device).

<br />

Constant Value: 1 (0x00000001)

### WIFI_INTERFACE_TYPE_AWARE

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_INTERFACE_TYPE_AWARE
```

Wi-Fi interface of type Wi-Fi Aware (aka NAN).

<br />

Constant Value: 2 (0x00000002)

### WIFI_INTERFACE_TYPE_DIRECT

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_INTERFACE_TYPE_DIRECT
```

Wi-Fi interface of type Wi-Fi Direct (aka P2P).

<br />

Constant Value: 3 (0x00000003)

### WIFI_INTERFACE_TYPE_STA

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_INTERFACE_TYPE_STA
```

Wi-Fi interface of type STA (station/client Wi-Fi infrastructure device).

<br />

Constant Value: 0 (0x00000000)

### WIFI_MODE_FULL

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MODE_FULL
```

<br />

**This constant was deprecated in API level 29.**   

This API is non-functional and will have no impact.

In this Wi-Fi lock mode, Wi-Fi will be kept active, and will behave normally, i.e., it will attempt to automatically establish a connection to a remembered access point that is within range, and will do periodic scans if there are remembered access points but none are in range.

<br />

Constant Value: 1 (0x00000001)

### WIFI_MODE_FULL_HIGH_PERF

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MODE_FULL_HIGH_PERF
```

<br />

**This constant was deprecated in API level 34.**   

The `WIFI_MODE_FULL_HIGH_PERF` is deprecated and is automatically replaced with `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` with all the restrictions documented on that lock. I.e. any request to the `WIFI_MODE_FULL_HIGH_PERF` will now obtain a `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` lock instead. Deprecation is due to the impact of `WIFI_MODE_FULL_HIGH_PERF` on power dissipation. The `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` provides much of the same desired functionality with less impact on power dissipation.

In this Wi-Fi lock mode, Wi-Fi will not go to power save. This results in operating with low packet latency. The lock is only active when the device is connected to an access point. The lock is active even when the device screen is off or the acquiring application is running in the background. This mode will consume more power and hence should be used only when there is a need for this tradeoff.

An example use case is when a voice connection needs to be kept active even after the device screen goes off. Holding a `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF` lock for the duration of the voice call may improve the call quality.

When there is no support from the hardware, the `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF` lock will have no impact.

<br />

Constant Value: 3 (0x00000003)

### WIFI_MODE_FULL_LOW_LATENCY

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MODE_FULL_LOW_LATENCY
```

In this Wi-Fi lock mode, Wi-Fi will operate with a priority to achieve low latency. `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` lock has the following limitations:

1. The lock is only active when the device is connected to an access point.
2. The lock is only active when the screen is on.
3. The lock is only active when the acquiring app is running in the foreground.

Low latency mode optimizes for reduced packet latency, and as a result other performance measures may suffer when there are trade-offs to make:

<!-- -->

1. Battery life may be reduced.
2. Throughput may be reduced.
3. Frequency of Wi-Fi scanning may be reduced. This may result in:
   - The device may not roam or switch to the AP with highest signal quality.
   - Location accuracy may be reduced.

Example use cases are real time gaming or virtual reality applications where low latency is a key factor for user experience.

Note: For an app which acquires both `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` and `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF` locks, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` lock will be effective when app is running in foreground and screen is on, while the `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF` lock will take effect otherwise.

<br />

Constant Value: 4 (0x00000004)

### WIFI_MODE_SCAN_ONLY

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MODE_SCAN_ONLY
```

<br />

**This constant was deprecated in API level 29.**   

This API is non-functional and will have no impact.

In this Wi-Fi lock mode, Wi-Fi will be kept active, but the only operation that will be supported is initiation of scans, and the subsequent reporting of scan results. No attempts will be made to automatically connect to remembered access points, nor will periodic scans be automatically performed looking for remembered access points. Scans must be explicitly requested by an application in this mode.

<br />

Constant Value: 2 (0x00000002)

### WIFI_MULTI_INTERNET_MODE_DBS_AP

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MULTI_INTERNET_MODE_DBS_AP
```

Wi-Fi simultaneous connection to multiple internet-providing Wi-FI networks (APs) is enabled and restricted to a single network on different bands (e.g. a DBS AP).

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#getStaConcurrencyForMultiInternetMode()`

Constant Value: 1 (0x00000001)

### WIFI_MULTI_INTERNET_MODE_DISABLED

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MULTI_INTERNET_MODE_DISABLED
```

Wi-Fi simultaneous connection to multiple internet-providing Wi-Fi networks (APs) is disabled.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#getStaConcurrencyForMultiInternetMode()`

Constant Value: 0 (0x00000000)

### WIFI_MULTI_INTERNET_MODE_MULTI_AP

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_MULTI_INTERNET_MODE_MULTI_AP
```

Wi-Fi simultaneous connection to multiple internet-providing Wi-Fi networks (APs) is enabled. The device can connect to any networks/APs - it is just restricted to using different bands for individual connections.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#getStaConcurrencyForMultiInternetMode()`

Constant Value: 2 (0x00000002)

### WIFI_STATE_CHANGED_ACTION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String WIFI_STATE_CHANGED_ACTION
```

Broadcast intent action indicating that Wi-Fi has been enabled, disabled, enabling, disabling, or unknown. One extra provides this state as an int. Another extra provides the previous state, if available. No network-related permissions are required to subscribe to this broadcast.

This broadcast is not delivered to manifest receivers in applications that target API version 26 or later.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_WIFI_STATE`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#EXTRA_PREVIOUS_WIFI_STATE`

Constant Value: "android.net.wifi.WIFI_STATE_CHANGED"

### WIFI_STATE_DISABLED

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_STATE_DISABLED
```

Wi-Fi is disabled.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_CHANGED_ACTION`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()`

Constant Value: 1 (0x00000001)

### WIFI_STATE_DISABLING

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_STATE_DISABLING
```

Wi-Fi is currently being disabled. The state will change to `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLED` if it finishes successfully.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_CHANGED_ACTION`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()`

Constant Value: 0 (0x00000000)

### WIFI_STATE_ENABLED

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_STATE_ENABLED
```

Wi-Fi is enabled.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_CHANGED_ACTION`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()`

Constant Value: 3 (0x00000003)

### WIFI_STATE_ENABLING

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_STATE_ENABLING
```

Wi-Fi is currently being enabled. The state will change to `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLED` if it finishes successfully.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_CHANGED_ACTION`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()`

Constant Value: 2 (0x00000002)

### WIFI_STATE_UNKNOWN

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_STATE_UNKNOWN
```

Wi-Fi is in an unknown state. This state will occur when an error happens while enabling or disabling.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_CHANGED_ACTION`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()`

Constant Value: 4 (0x00000004)

### WPS_AUTH_FAILURE

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WPS_AUTH_FAILURE
```

<br />

**This constant was deprecated in API level 28.**   

This is deprecated

Authentication failure on WPS

<br />

Constant Value: 6 (0x00000006)

### WPS_OVERLAP_ERROR

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WPS_OVERLAP_ERROR
```

<br />

**This constant was deprecated in API level 28.**   

This is deprecated

WPS overlap detected

<br />

Constant Value: 3 (0x00000003)

### WPS_TIMED_OUT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WPS_TIMED_OUT
```

<br />

**This constant was deprecated in API level 28.**   

This is deprecated

WPS timed out

<br />

Constant Value: 7 (0x00000007)

### WPS_TKIP_ONLY_PROHIBITED

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WPS_TKIP_ONLY_PROHIBITED
```

<br />

**This constant was deprecated in API level 28.**   

This is deprecated

TKIP only prohibited

<br />

Constant Value: 5 (0x00000005)

### WPS_WEP_PROHIBITED

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WPS_WEP_PROHIBITED
```

<br />

**This constant was deprecated in API level 28.**   

This is deprecated

WEP on WPS is prohibited

<br />

Constant Value: 4 (0x00000004)

## Public methods

### addLocalOnlyConnectionFailureListener

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addLocalOnlyConnectionFailureListener (Executor executor, 
                WifiManager.LocalOnlyConnectionFailureListener listener)
```

Add a listener for local-only networks. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier`. Specify the caller will only get connection failures for networks they requested. Caller can remove a previously registered listener using `https://developer.android.com/reference/android/net/wifi/WifiManager#removeLocalOnlyConnectionFailureListener(android.net.wifi.WifiManager.LocalOnlyConnectionFailureListener)` Same caller can add multiple listeners to monitor the event.

Applications should have the `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE` permissions. Callers without the permission will trigger a `https://developer.android.com/reference/java/lang/SecurityException`.

.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor to execute the listener of the `listener` object. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `listener` | `WifiManager.LocalOnlyConnectionFailureListener`: listener for local-only network connection failure. This value cannot be `null`. <br /> |

### addNetwork

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int addNetwork (WifiConfiguration config)
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `-1`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Add a new network description to the set of configured networks. The `networkId` field of the supplied configuration object is ignored.

<br />

The new network will be marked DISABLED by default. To enable it, called `https://developer.android.com/reference/android/net/wifi/WifiManager#enableNetwork(int,%20boolean)`.

<br />

<br />

| Parameters ||
|---|---|
| `config` | `WifiConfiguration`: the set of variables that describe the configuration, contained in a `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` object. If the `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` has an Http Proxy set the calling app must be System, or be provisioned as the Profile or Device Owner. <br /> |

| Returns ||
|---|---|
| `int` | the ID of the newly created network description. This is used in other operations to specified the network to be acted upon. Returns `-1` on failure. <br /> |

### addNetworkPrivileged

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiManager.AddNetworkResult addNetworkPrivileged (WifiConfiguration config)
```

This is a new version of `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)` which returns more detailed failure codes. The usage of this API is limited to Device Owner (DO), Profile Owner (PO), system app, and privileged apps.

Add a new network description to the set of configured networks. The `networkId` field of the supplied configuration object is ignored. The new network will be marked DISABLED by default. To enable it, call `https://developer.android.com/reference/android/net/wifi/WifiManager#enableNetwork(int,%20boolean)`.

<br />

<br />

| Parameters ||
|---|---|
| `config` | `WifiConfiguration`: the set of variables that describe the configuration, contained in a `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` object. If the `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` has an Http Proxy set the calling app must be System, or be provisioned as the Profile or Device Owner. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiManager.AddNetworkResult` | A `https://developer.android.com/reference/android/net/wifi/WifiManager.AddNetworkResult` Object. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the input configuration is null or if the security type in input configuration is not supported. |
| `https://developer.android.com/reference/java/lang/SecurityException` | if the calling app is not a Device Owner (DO), Profile Owner (PO), system app, or a privileged app that has one of the permissions required by this API. |

### addNetworkSuggestions

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int addNetworkSuggestions (List<WifiNetworkSuggestion> networkSuggestions)
```

Provide a list of network suggestions to the device. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` for a detailed explanation of the parameters. When the device decides to connect to one of the provided network suggestions, platform sends a directed broadcast `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION` to the app if the network was created with `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsAppInteractionRequired(boolean)` flag set and the app holds `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` permission.

NOTE:

- These networks are just a suggestion to the platform. The platform will ultimately decide on which network the device connects to.
- When an app is uninstalled or disabled, all its suggested networks are discarded. If the device is currently connected to a suggested network which is being removed then the device will disconnect from that network.
- If user reset network settings, all added suggestions will be discarded. Apps can use `https://developer.android.com/reference/android/net/wifi/WifiManager#getNetworkSuggestions()` to check if their suggestions are in the device.
- In-place modification of existing suggestions are allowed.
  - If the provided suggestions include any previously provided suggestions by the app, previous suggestions will be updated.
  - If one of the provided suggestions marks a previously unmetered suggestion as metered and the device is currently connected to that suggested network, then the device will disconnect from that network. The system will immediately re-evaluate all the network candidates and possibly reconnect back to the same suggestion. This disconnect is to make sure that any traffic flowing over unmetered networks isn't accidentally continued over a metered network.
  - On `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` or above If one of the provided suggestions marks a previously trusted suggestion as untrusted and the device is currently connected to that suggested network, then the device will disconnect from that network. The system will immediately re-evaluate all the network candidates. This disconnect is to make sure device will not remain connected to an untrusted network without a related `https://developer.android.com/reference/android/net/NetworkRequest`.

.   
Requires `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`

<br />

<br />

| Parameters ||
|---|---|
| `networkSuggestions` | `List`: List of network suggestions provided by the app. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | Status code for the operation. One of the STATUS_NETWORK_SUGGESTIONS_ values. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_SUCCESS` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_RESTRICTED_BY_ADMIN` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the caller is missing required permissions. |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#equals(java.lang.Object)`

### addOrUpdatePasspointConfiguration

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addOrUpdatePasspointConfiguration (PasspointConfiguration config)
```

Add or update 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 a unique key which depends on the contents of the configuration. This allows the caller to install multiple profiles with the same FQDN (Fully qualified domain name). Therefore, in order to update an existing profile, it is first required to remove it using `https://developer.android.com/reference/android/net/wifi/WifiManager#removePasspointConfiguration(java.lang.String)`. Otherwise, a new profile will be added with both configuration. Deprecated for general app usage - except DO/PO apps. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPasspointConfig(android.net.wifi.hotspot2.PasspointConfiguration)` to create a passpoint suggestion. See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or above, this API will always fail and throw `https://developer.android.com/reference/java/lang/IllegalArgumentException`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

<br />

| Parameters ||
|---|---|
| `config` | `PasspointConfiguration`: The Passpoint configuration to be added <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if configuration is invalid or Passpoint is not enabled on the device. |

### addSuggestionConnectionStatusListener

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addSuggestionConnectionStatusListener (Executor executor, 
                WifiManager.SuggestionConnectionStatusListener listener)
```

Add a listener for suggestion networks. See `https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionConnectionStatusListener`. Caller will receive the event when suggested network have connection failure. Caller can remove a previously registered listener using `https://developer.android.com/reference/android/net/wifi/WifiManager#removeSuggestionConnectionStatusListener(android.net.wifi.WifiManager.SuggestionConnectionStatusListener)` Same caller can add multiple listeners to monitor the event.

Applications should have the `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE` permissions. Callers without the permission will trigger a `https://developer.android.com/reference/java/lang/SecurityException`.

.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor to execute the listener of the `listener` object. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `listener` | `WifiManager.SuggestionConnectionStatusListener`: listener for suggestion network connection failure. This value cannot be `null`. <br /> |

### addSuggestionUserApprovalStatusListener

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addSuggestionUserApprovalStatusListener (Executor executor, 
                WifiManager.SuggestionUserApprovalStatusListener listener)
```

Add a listener for Wi-Fi network suggestion user approval status. See `https://developer.android.com/reference/android/net/wifi/WifiManager.SuggestionUserApprovalStatusListener`. Caller will receive a callback immediately after adding a listener and when the user approval status of the caller has changed. Caller can remove a previously registered listener using `https://developer.android.com/reference/android/net/wifi/WifiManager#removeSuggestionUserApprovalStatusListener(android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener)` A caller can add multiple listeners to monitor the event.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor to execute the listener of the `listener` object. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `listener` | `WifiManager.SuggestionUserApprovalStatusListener`: listener for suggestion user approval status changes. This value cannot be `null`. <br /> |

### addWifiStateChangedListener

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addWifiStateChangedListener (Executor executor, 
                WifiManager.WifiStateChangedListener listener)
```

Register a callback for Wi-Fi state. See `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiStateChangedListener`. Caller will receive the event when the Wi-Fi state changes. Caller can remove a previously registered callback using `https://developer.android.com/reference/android/net/wifi/WifiManager#removeWifiStateChangedListener(android.net.wifi.WifiManager.WifiStateChangedListener)`   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: Executor to execute listener callback on. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `listener` | `WifiManager.WifiStateChangedListener`: Listener to register. This value cannot be `null`. <br /> |

### allowAutojoinGlobal

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void allowAutojoinGlobal (boolean allowAutojoin)
```

Control whether the device will automatically search for and connect to Wi-Fi networks - auto-join Wi-Fi networks. Disabling this option will not impact manual connections - i.e. the user will still be able to manually select and connect to a Wi-Fi network. Disabling this option significantly impacts the device connectivity and is a restricted operation (see below for permissions). Note that disabling this operation will also disable connectivity initiated scanning operations.

Disabling the auto-join configuration is a temporary operation (with the exception of a DO/PO caller): it will be reset (to enabled) when the device reboots or the user toggles Wi-Fi off/on. When the caller is a DO/PO then toggling Wi-Fi will not reset the configuration. Additionally, if a DO/PO disables auto-join then it cannot be (re)enabled by a non-DO/PO caller.

<br />

| Parameters ||
|---|---|
| `allowAutojoin` | `boolean`: true to allow auto-join, false to disallow auto-join Available for DO/PO apps. Other apps require `android.Manifest.permission#NETWORK_SETTINGS` or `android.Manifest.permission#MANAGE_WIFI_NETWORK_SELECTION` permission. <br /> |

### calculateSignalLevel

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int calculateSignalLevel (int rssi)
```

Given a raw RSSI, return the RSSI signal quality rating using the system default RSSI quality rating thresholds.

<br />

| Parameters ||
|---|---|
| `rssi` | `int`: a raw RSSI value, in dBm, usually between -55 and -90 <br /> |

| Returns ||
|---|---|
| `int` | the RSSI signal quality rating, in the range \[0, `https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxSignalLevel()`\], where 0 is the lowest (worst signal) RSSI rating and `https://developer.android.com/reference/android/net/wifi/WifiManager#getMaxSignalLevel()` is the highest (best signal) RSSI rating. Value is 0 or greater <br /> |

### calculateSignalLevel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int calculateSignalLevel (int rssi, 
                int numLevels)
```

<br />

**This method was deprecated in API level 30.**   

Callers should use `https://developer.android.com/reference/android/net/wifi/WifiManager#calculateSignalLevel(int)` instead to get the signal level using the system default RSSI thresholds, or otherwise compute the RSSI level themselves using their own formula.

Calculates the level of the signal. This should be used any time a signal is being shown.

<br />

| Parameters ||
|---|---|
| `rssi` | `int`: The power of the signal measured in RSSI. <br /> |
| `numLevels` | `int`: The number of levels to consider in the calculated level. <br /> |

| Returns ||
|---|---|
| `int` | A level of the signal, given in the range of 0 to numLevels-1 (both inclusive). <br /> |

### cancelWps

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void cancelWps (WifiManager.WpsCallback listener)
```

<br />

**This method was deprecated in API level 28.**   

This API is deprecated

WPS support has been deprecated from Client mode and this method will immediately trigger `https://developer.android.com/reference/android/net/wifi/WifiManager.WpsCallback#onFailed(int)` with a generic error.

<br />

| Parameters ||
|---|---|
| `listener` | `WifiManager.WpsCallback`: for callbacks on success or failure. Can be null. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if the WifiManager instance needs to be initialized again |

### compareSignalLevel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int compareSignalLevel (int rssiA, 
                int rssiB)
```

Compares two signal strengths.

<br />

| Parameters ||
|---|---|
| `rssiA` | `int`: The power of the first signal measured in RSSI. <br /> |
| `rssiB` | `int`: The power of the second signal measured in RSSI. <br /> |

| Returns ||
|---|---|
| `int` | Returns \<0 if the first signal is weaker than the second signal, 0 if the two signals have the same strength, and \>0 if the first signal is stronger than the second signal. <br /> |

### createMulticastLock

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiManager.MulticastLock createMulticastLock (String tag)
```

Create a new MulticastLock

<br />

| Parameters ||
|---|---|
| `tag` | `String`: a tag for the MulticastLock to identify it in debugging messages. This string is never shown to the user under normal conditions, but should be descriptive enough to identify your application and the specific MulticastLock within it, if it holds multiple MulticastLocks. The maximum string length is 255. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock` | a new, unacquired MulticastLock with the given tag. <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock`

### createWifiLock

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiManager.WifiLock createWifiLock (String tag)
```

<br />

**This method was deprecated in API level 29.**   

This API is non-functional.

Creates a new WifiLock.

<br />

| Parameters ||
|---|---|
| `tag` | `String`: a tag for the WifiLock to identify it in debugging messages. This string is never shown to the user under normal conditions, but should be descriptive enough to identify your application and the specific WifiLock within it, if it holds multiple WifiLocks. The maximum string length is 255. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock` | a new, unacquired WifiLock with the given tag. <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock`

### createWifiLock

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiManager.WifiLock createWifiLock (int lockType, 
                String tag)
```

Creates a new WifiLock.

<br />

| Parameters ||
|---|---|
| `lockType` | `int`: the type of lock to create. See `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF` and `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_LOW_LATENCY` for descriptions of the types of Wi-Fi locks. <br /> |
| `tag` | `String`: a tag for the WifiLock to identify it in debugging messages. This string is never shown to the user under normal conditions, but should be descriptive enough to identify your application and the specific WifiLock within it, if it holds multiple WifiLocks. The maximum string length is 255. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock` | a new, unacquired WifiLock with the given tag. <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock`

### disableNetwork

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean disableNetwork (int netId)
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Disable a configured network. The specified network will not be a candidate for associating. This may result in the asynchronous delivery of state change events. Applications are not allowed to disable networks created by other applications.

<br />

| Parameters ||
|---|---|
| `netId` | `int`: the ID of the network as returned by `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#getConfiguredNetworks()`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded <br /> |

### disallowCurrentSuggestedNetwork

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void disallowCurrentSuggestedNetwork (BlockingOption blockingOption)
```

When the device is connected to a network suggested by calling app `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, this API provide a way to avoid the current connection without `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`. The disallowed network will be disconnected or roam to other networks. App can only use this API to control the current connected network which was suggested by this app.   

Requires `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `blockingOption` | `BlockingOption`: Option to change for the network blocking `https://developer.android.com/reference/android/net/wifi/BlockingOption` This value cannot be `null`. <br /> |

### disconnect

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean disconnect ()
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Disassociate from the currently active access point. This may result in the asynchronous delivery of state change events.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded <br /> |

### enableNetwork

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean enableNetwork (int netId, 
                boolean attemptConnect)
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Allow a previously configured network to be associated with. If `attemptConnect` is true, an attempt to connect to the selected network is initiated. This may result in the asynchronous delivery of state change events.

**Note:** Network communication may not use Wi-Fi even if Wi-Fi is connected; traffic may instead be sent through another network, such as cellular data, Bluetooth tethering, or Ethernet. For example, traffic will never use a Wi-Fi network that does not provide Internet access (e.g. a wireless printer), if another network that does offer Internet access (e.g. cellular data) is available. Applications that need to ensure that their network traffic uses Wi-Fi should use APIs such as `https://developer.android.com/reference/android/net/Network#bindSocket(java.net.Socket)`, `https://developer.android.com/reference/android/net/Network#openConnection(java.net.URL)`, or `https://developer.android.com/reference/android/net/ConnectivityManager#bindProcessToNetwork(android.net.Network)` to do so. Applications are not allowed to enable networks created by other applications.

<br />

| Parameters ||
|---|---|
| `netId` | `int`: the ID of the network as returned by `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#getConfiguredNetworks()`. <br /> |
| `attemptConnect` | `boolean`: The way to select a particular network to connect to is specify `true` for this parameter. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded <br /> |

### flushPasspointAnqpCache

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void flushPasspointAnqpCache ()
```

Flush Passpoint ANQP cache, and clear pending ANQP requests. Allows the caller to reset the Passpoint ANQP state, if required. Notes: 1. Flushing the ANQP cache may cause delays in discovering and connecting to Passpoint networks. 2. Intended to be used by Device Owner (DO), Profile Owner (PO), Settings and provisioning apps.

<br />

### getAllowedChannels

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<WifiAvailableChannel> getAllowedChannels (int band, 
                int mode)
```

Returns a list of `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel` for the specified band and operational mode(s), that is allowed for the current regulatory domain. An empty list implies that there are no available channels for use. Note: the `band` parameter which is specified as a `WifiScanner#WIFI_BAND_*` constant is limited to one of the band values specified below. Specifically, if the 5GHz band is included then it must include the DFS channels - an exception will be thrown otherwise. The caller should not make any assumptions about whether DFS channels are allowed. This API will indicate whether DFS channels are allowed for the specified operation mode(s) per device policy.   

Requires `https://developer.android.com/reference/android/Manifest.permission#NEARBY_WIFI_DEVICES`

<br />

| Parameters ||
|---|---|
| `band` | `int`: one of the following band constants defined in `WifiScanner#WIFI_BAND_*` constants. 1. `WifiScanner#WIFI_BAND_UNSPECIFIED`=0 - no band specified; Looks for the channels in all the available bands - 2.4 GHz, 5 GHz, 6 GHz and 60 GHz 2. `WifiScanner#WIFI_BAND_24_GHZ`=1 3. `WifiScanner#WIFI_BAND_5_GHZ_WITH_DFS`=6 4. `WifiScanner#WIFI_BAND_BOTH_WITH_DFS`=7 5. `WifiScanner#WIFI_BAND_6_GHZ`=8 6. `WifiScanner#WIFI_BAND_24_5_WITH_DFS_6_GHZ`=15 7. `WifiScanner#WIFI_BAND_60_GHZ`=16 8. `WifiScanner#WIFI_BAND_24_5_WITH_DFS_6_60_GHZ`=31 <br /> |
| `mode` | `int`: Bitwise OR of `WifiAvailableChannel#OP_MODE_*` constants e.g. `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_AWARE` Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_STA` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_SAP` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_DIRECT_CLI` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_DIRECT_GO` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_AWARE` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_TDLS` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel>` | a list of `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel` This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | - if this API is not supported on this device or IllegalArgumentException - if the band specified is not one among the list of bands mentioned above. |

### getCallerConfiguredNetworks

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<WifiConfiguration> getCallerConfiguredNetworks ()
```

Return a list of all the networks previously configured by the calling app. Can be called by Device Owner (DO), Profile Owner (PO), Callers with Carrier privilege and system apps.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiConfiguration>` | a list of network configurations in the form of a list of `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` objects. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the caller is not allowed to call this API |

### getChannelData

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getChannelData (Executor executor, 
                Consumer<List<Bundle>> resultsCallback)
```

Get channel data such as the number of APs found on each channel from the most recent scan. App requires `https://developer.android.com/reference/android/Manifest.permission#NEARBY_WIFI_DEVICES`   

Requires `https://developer.android.com/reference/android/Manifest.permission#NEARBY_WIFI_DEVICES`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: A callback that will return `List<Bundle>` containing channel data such as the number of APs found on each channel. `https://developer.android.com/reference/android/net/wifi/WifiManager#CHANNEL_DATA_KEY_FREQUENCY_MHZ` and `https://developer.android.com/reference/android/net/wifi/WifiManager#CHANNEL_DATA_KEY_NUM_AP` are used to get the frequency (Mhz) and number of APs. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |
| `https://developer.android.com/reference/java/lang/SecurityException` | if the caller does not have permission. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the API is not supported on this SDK version. |

### getConfiguredNetworks

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<WifiConfiguration> getConfiguredNetworks ()
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return an empty list.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps will have access to the full list.
- Callers with Carrier privilege will receive a restricted list only containing configurations which they created.

<br />

Return a list of all the networks configured for the current foreground user. Not all fields of WifiConfiguration are returned. Only the following fields are filled in:

- networkId
- SSID
- BSSID
- priority
- allowedProtocols
- allowedKeyManagement
- allowedAuthAlgorithms
- allowedPairwiseCiphers
- allowedGroupCiphers
- status

.   
Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiConfiguration>` | a list of network configurations in the form of a list of `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` objects. <br /> |

### getConnectionInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiInfo getConnectionInfo ()
```

<br />

**This method was deprecated in API level 31.**   

Starting with `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`, WifiInfo retrieval is moved to `https://developer.android.com/reference/android/net/ConnectivityManager` API surface. WifiInfo is attached in `https://developer.android.com/reference/android/net/NetworkCapabilities#getTransportInfo()` which is available via callback in `https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback#onCapabilitiesChanged(android.net.Network,%20android.net.NetworkCapabilities)` or on-demand from `https://developer.android.com/reference/android/net/ConnectivityManager#getNetworkCapabilities(android.net.Network)`.
Usage example:

```
 final NetworkRequest request =
      new NetworkRequest.Builder()
      .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
      .build();
 final ConnectivityManager connectivityManager =
      context.getSystemService(ConnectivityManager.class);
 final NetworkCallback networkCallback = new NetworkCallback() {
      ...
      @Override
      void onAvailable(Network network) {}

      @Override
      void onCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities) {
          WifiInfo wifiInfo = (WifiInfo) networkCapabilities.getTransportInfo();
      }
      // etc.
 };
 connectivityManager.requestNetwork(request, networkCallback); // For request
 connectivityManager.registerNetworkCallback(request, networkCallback); // For listen
 
```

**Compatibility Notes:**
- Apps can continue using this API, however newer features such as ability to mask out location sensitive data in WifiInfo will not be supported via this API.
- On devices supporting concurrent connections (indicated via `https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForLocalOnlyConnectionsSupported()`, etc) this API will return the details of the internet providing connection (if any) to all apps, except for the apps that triggered the creation of the concurrent connection. For such apps, this API will return the details of the connection they created. e.g. apps using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier` will trigger a concurrent connection on supported devices and hence this API will provide details of their peer to peer connection (not the internet providing connection). This is to maintain backwards compatibility with behavior on single STA devices.
- Return dynamic information about the current Wi-Fi connection, if any is active.

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiInfo` | the Wi-Fi information, contained in `https://developer.android.com/reference/android/net/wifi/WifiInfo`. <br /> |

### getDhcpInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DhcpInfo getDhcpInfo ()
```

<br />

**This method was deprecated in API level 31.**   

Use the methods on `https://developer.android.com/reference/android/net/LinkProperties` which can be obtained either via `https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback#onLinkPropertiesChanged(android.net.Network,%20android.net.LinkProperties)` or `https://developer.android.com/reference/android/net/ConnectivityManager#getLinkProperties(android.net.Network)`.

**Compatibility Notes:**
- On devices supporting concurrent connections (indicated via `https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForLocalOnlyConnectionsSupported()`, etc), this API will return the details of the internet providing connection (if any) to all apps, except for the apps that triggered the creation of the concurrent connection. For such apps, this API will return the details of the connection they created. e.g. apps using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier` will trigger a concurrent connection on supported devices and hence this API will provide details of their peer to peer connection (not the internet providing connection). This is to maintain backwards compatibility with behavior on single STA devices.
- Return the DHCP-assigned addresses from the last successful DHCP request, if any.

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/DhcpInfo` | the DHCP information <br /> |

### getMaxNumberOfChannelsPerNetworkSpecifierRequest

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxNumberOfChannelsPerNetworkSpecifierRequest ()
```

Returns the max number of channels that is allowed to be set on a `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier`.

<br />

| Returns ||
|---|---|
| `int` | The max number of channels can be set on a request. <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#setPreferredChannelsFrequenciesMhz(int[])`

### getMaxNumberOfNetworkSuggestionsPerApp

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxNumberOfNetworkSuggestionsPerApp ()
```

Returns the max number of network suggestions that are allowed per app on the device.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`
- `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`

### getMaxSignalLevel

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxSignalLevel ()
```

Get the system default maximum signal level. This is the maximum RSSI level returned by `https://developer.android.com/reference/android/net/wifi/WifiManager#calculateSignalLevel(int)`.

<br />

| Returns ||
|---|---|
| `int` | Value is 0 or greater <br /> |

### getMaxSupportedConcurrentTdlsSessions

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getMaxSupportedConcurrentTdlsSessions (Executor executor, 
                Consumer<Integer> resultsCallback)
```

Return the maximum number of concurrent TDLS sessions supported by the device.

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return the maximum number of concurrent TDLS sessions supported by the device. Returns `-1` if information is not available, e.g. if the driver/firmware doesn't provide this information. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the feature is not available. |

### getNetworkSuggestions

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<WifiNetworkSuggestion> getNetworkSuggestions ()
```

Get all network suggestions provided by the calling app. See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` See `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion>` | a list of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` This value cannot be `null`. <br /> |

### getNumberOfEnabledTdlsSessions

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getNumberOfEnabledTdlsSessions (Executor executor, 
                Consumer<Integer> resultsCallback)
```

Return the number of currently enabled TDLS sessions. Tracks the number of peers enabled for TDLS session via `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)` and `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return the number of Peer Mac addresses configured in the driver for TDLS session. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |

### getPasspointConfigurations

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<PasspointConfiguration> getPasspointConfigurations ()
```

<br />

**This method was deprecated in API level 29.**   

This will be non-functional in a future release.   

Requires `android.Manifest.permission.NETWORK_SETTINGS` or `android.Manifest.permission.NETWORK_SETUP_WIZARD`.

Return the list of installed Passpoint configurations added by the caller. An empty list will be returned when no configurations are installed.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration>` | A list of `https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration` added by the caller <br /> |

### getPerSsidRoamingModes

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getPerSsidRoamingModes (Executor executor, 
                Consumer<Map<String, Integer>> resultsCallback)
```

This API allows a privileged application to get roaming mode policies configured using the `https://developer.android.com/reference/android/net/wifi/WifiManager#setPerSsidRoamingMode(android.net.wifi.WifiSsid,%20int)`. Available for Device Owner (DO) and profile owner of an organization owned device. Other apps require `android.Manifest.permission#NETWORK_SETTINGS` or `android.Manifest.permission#MANAGE_WIFI_NETWORK_SELECTION` permission.

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return the corresponding roaming policies for the API caller. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if caller does not have the required permission. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the API is not supported on this SDK version. |

### getScanResults

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<ScanResult> getScanResults ()
```

Return the results of the latest access point scan.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE` and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/ScanResult>` | the list of access points found in the most recent scan. An app must hold `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` permission and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE` permission in order to get valid results. When an Access Point\\u2019s beacon or probe response includes a Multi-BSSID Element, the returned scan results should include separate scan result for each BSSID within the Multi-BSSID Information Element. This includes both transmitted and non-transmitted BSSIDs. Original Multi-BSSID Element will be included in the Information Elements attached to each of the scan results. Note: This is the expected behavior for devices supporting 11ax (WiFi-6) and above, and an optional requirement for devices running with older WiFi generations. <br /> |

### getStaConcurrencyForMultiInternetMode

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getStaConcurrencyForMultiInternetMode ()
```

The device may support concurrent connections to multiple internet-providing Wi-Fi networks (APs) - that is indicated by `https://developer.android.com/reference/android/net/wifi/WifiManager#isStaConcurrencyForMultiInternetSupported()`. This method indicates whether or not the feature is currently enabled. A value of `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_DISABLED` indicates that the feature is disabled, a value of `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_DBS_AP` or `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_MULTI_AP` indicates that the feature is enabled. The app can register to receive the corresponding Wi-Fi networks using the `https://developer.android.com/reference/android/net/ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest,%20android.net.ConnectivityManager.NetworkCallback)` API with a `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier` configured using the `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#setBand(int)` method.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_DISABLED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_DBS_AP` - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MULTI_INTERNET_MODE_MULTI_AP` |

### getUsableChannels

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<WifiAvailableChannel> getUsableChannels (int band, 
                int mode)
```

Returns a list of `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel` for the specified band and operational mode(s) per the current regulatory domain and device-specific constraints such as concurrency state and interference due to other radios. An empty list implies that there are no available channels for use. Note: the `band` parameter which is specified as a `WifiScanner#WIFI_BAND_*` constant is limited to one of the band values specified below. Specifically, if the 5GHz band is included then it must include the DFS channels - an exception will be thrown otherwise. The caller should not make any assumptions about whether DFS channels are allowed. This API will indicate whether DFS channels are allowed for the specified operation mode(s) per device policy.   

Requires `https://developer.android.com/reference/android/Manifest.permission#NEARBY_WIFI_DEVICES`

<br />

| Parameters ||
|---|---|
| `band` | `int`: one of the following band constants defined in `WifiScanner#WIFI_BAND_*` constants. 1. `WifiScanner#WIFI_BAND_UNSPECIFIED`=0 - no band specified; Looks for the channels in all the available bands - 2.4 GHz, 5 GHz, 6 GHz and 60 GHz 2. `WifiScanner#WIFI_BAND_24_GHZ`=1 3. `WifiScanner#WIFI_BAND_5_GHZ_WITH_DFS`=6 4. `WifiScanner#WIFI_BAND_BOTH_WITH_DFS`=7 5. `WifiScanner#WIFI_BAND_6_GHZ`=8 6. `WifiScanner#WIFI_BAND_24_5_WITH_DFS_6_GHZ`=15 7. `WifiScanner#WIFI_BAND_60_GHZ`=16 8. `WifiScanner#WIFI_BAND_24_5_WITH_DFS_6_60_GHZ`=31 <br /> |
| `mode` | `int`: Bitwise OR of `WifiAvailableChannel#OP_MODE_*` constants e.g. `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_AWARE` Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_STA` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_SAP` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_DIRECT_CLI` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_DIRECT_GO` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_WIFI_AWARE` - `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel#OP_MODE_TDLS` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel>` | a list of `https://developer.android.com/reference/android/net/wifi/WifiAvailableChannel` This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | - if this API is not supported on this device or IllegalArgumentException - if the band specified is not one among the list of bands mentioned above. |

### getWifiState

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getWifiState ()
```

Gets the Wi-Fi enabled state.

<br />

| Returns ||
|---|---|
| `int` | One of `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLED`, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_DISABLING`, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLED`, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_ENABLING`, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_STATE_UNKNOWN` <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiEnabled()`

### is24GHzBandSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean is24GHzBandSupported ()
```

Check if the chipset supports 2.4GHz band.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if supported, `false` otherwise. <br /> |

### is5GHzBandSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean is5GHzBandSupported ()
```

Check if the chipset supports 5GHz band.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if supported, `false` otherwise. <br /> |

### is60GHzBandSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean is60GHzBandSupported ()
```

Check if the chipset supports the 60GHz frequency band.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if supported, `false` otherwise. <br /> |

### is6GHzBandSupported

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean is6GHzBandSupported ()
```

Check if the chipset supports 6GHz band.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if supported, `false` otherwise. <br /> |

### isAggressiveRoamingModeSupported

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAggressiveRoamingModeSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Aggressive roaming mode `https://developer.android.com/reference/android/net/wifi/WifiManager#setPerSsidRoamingMode(android.net.wifi.WifiSsid,%20int)` <br /> |

### isAutoWakeupEnabled

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAutoWakeupEnabled ()
```

Get the persisted Wi-Fi auto wakeup feature state. Defaults to false, unless changed by the user via Settings.

The feature is described in [https://source.android.com/devices/tech/connect/wifi-infrastructure #turn_on_wi-fi_automatically](https://developer.android.com/reference/android/net/wifi/Wi-Fi Turn on automatically).   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Returns ||
|---|---|
| `boolean` | true to indicate that wakeup feature is enabled, false to indicate that wakeup feature is disabled. <br /> |

### isBridgedApConcurrencySupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isBridgedApConcurrencySupported ()
```

Query whether or not the device supports multiple Access point (AP) which are bridged together.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports concurrency of multiple AP which bridged together, false otherwise. <br /> |

### isCarrierNetworkOffloadEnabled

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isCarrierNetworkOffloadEnabled (int subscriptionId, 
                boolean merged)
```

Get the carrier network offload state for merged or unmerged networks for specified subscription.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `subscriptionId` | `int`: subscription ID see `https://developer.android.com/reference/android/telephony/SubscriptionInfo#getSubscriptionId()` <br /> |
| `merged` | `boolean`: True for carrier merged network, false otherwise. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)` <br /> |

| Returns ||
|---|---|
| `boolean` | True to indicate that carrier network offload is enabled, false otherwise. <br /> |

### isD2dSupportedWhenInfraStaDisabled

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isD2dSupportedWhenInfraStaDisabled ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this devices supports device-to-device (D2d) Wi-Fi use-cases such as Wi-Fi Direct when infra station (STA) is disabled. <br /> |

### isDecoratedIdentitySupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isDecoratedIdentitySupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports RFC 7542 decorated identity. <br /> |

### isDeviceToApRttSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isDeviceToApRttSupported ()
```

<br />

**This method was deprecated in API level 29.**   

Please use `https://developer.android.com/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String)` with `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_WIFI_RTT`.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this adapter supports Device-to-AP RTT <br /> |

### isDualBandSimultaneousSupported

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isDualBandSimultaneousSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Dual Band Simultaneous (DBS) operation. <br /> |

### isEasyConnectDppAkmSupported

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEasyConnectDppAkmSupported ()
```

Wi-Fi Easy Connect DPP AKM enables provisioning and configuration of Wi-Fi devices without the need of using the device PSK passphrase. For more details, visit <https://www.wi-fi.org/> and search for "Easy Connect" or "Device Provisioning Protocol specification".

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Wi-Fi Easy-connect DPP (Device Provisioning Protocol) AKM, false otherwise. <br /> |

### isEasyConnectEnrolleeResponderModeSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEasyConnectEnrolleeResponderModeSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Wi-Fi Easy Connect (DPP) Enrollee Responder mode. <br /> |

### isEasyConnectSupported

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEasyConnectSupported ()
```

Wi-Fi Easy Connect (DPP) introduces standardized mechanisms to simplify the provisioning and configuration of Wi-Fi devices. For more details, visit <https://www.wi-fi.org/> and search for "Easy Connect" or "Device Provisioning Protocol specification".

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Wi-Fi Easy-connect (Device Provisioning Protocol) <br /> |

### isEnhancedOpenSupported

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEnhancedOpenSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Wi-Fi Enhanced Open (OWE) <br /> |

### isEnhancedPowerReportingSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEnhancedPowerReportingSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this adapter supports advanced power/performance counters <br /> |

### isMakeBeforeBreakWifiSwitchingSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isMakeBeforeBreakWifiSwitchingSupported ()
```

Query whether or not the device supports concurrent station (STA) connections for make-before-break wifi to wifi switching. Note: This is an internal feature which is not available to apps.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports multiple STA concurrency for this use-case, false otherwise. <br /> |

### isP2pSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isP2pSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this adapter supports WifiP2pManager (Wi-Fi Direct) <br /> |

### isPasspointTermsAndConditionsSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isPasspointTermsAndConditionsSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Wi-Fi Passpoint Terms and Conditions feature. <br /> |

### isPreferredNetworkOffloadSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isPreferredNetworkOffloadSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this adapter supports offloaded connectivity scan <br /> |

### isScanAlwaysAvailable

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isScanAlwaysAvailable ()
```

<br />

**This method was deprecated in API level 29.**   

The ability for apps to trigger scan requests will be removed in a future release.

Check if scanning is always available. If this return `true`, apps can issue `https://developer.android.com/reference/android/net/wifi/WifiManager#startScan()` and fetch scan results even when Wi-Fi is turned off. To change this setting, see `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isScanThrottleEnabled

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isScanThrottleEnabled ()
```

Get the persisted Wi-Fi scan throttle state. Defaults to true, unless changed by the user via Developer options.

The throttling limits for apps are described in [https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling](https://developer.android.com/reference/android/net/wifi/Wi-Fi Scan Throttling)
.   
Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true to indicate that scan throttling is enabled, false to indicate that scan throttling is disabled. <br /> |

### isStaApConcurrencySupported

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isStaApConcurrencySupported ()
```

Query whether or not the device supports Station (STA) + Access point (AP) concurrency.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports STA + AP concurrency, false otherwise. <br /> |

### isStaBridgedApConcurrencySupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isStaBridgedApConcurrencySupported ()
```

Query whether or not the device supports concurrency of Station (STA) + multiple access points (AP) (where the APs bridged together).

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports concurrency of STA + multiple APs which are bridged together, false otherwise. <br /> |

### isStaConcurrencyForLocalOnlyConnectionsSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isStaConcurrencyForLocalOnlyConnectionsSupported ()
```

Query whether or not the device supports concurrent station (STA) connections for local-only connections using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier`.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports multiple STA concurrency for this use-case, false otherwise. <br /> |

### isStaConcurrencyForMultiInternetSupported

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isStaConcurrencyForMultiInternetSupported ()
```

Query whether or not the device supports concurrent station (STA) connections for multi internet connections.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports multiple STA concurrency for this use-case, false otherwise. <br /> |

### isTdlsOperationCurrentlyAvailable

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void isTdlsOperationCurrentlyAvailable (Executor executor, 
                Consumer<Boolean> resultsCallback)
```

Check if a TDLS session can be established at this time via `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.Boolean>)` Internally framework checks the STA connected state, device support for TDLS and the number of TDLS sessions available in driver/firmware.

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return `Boolean` indicating whether a TDLS session can be established at this time. `true` for available, `false` for not available. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |

### isTdlsSupported

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTdlsSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this adapter supports Tunnel Directed Link Setup <br /> |

### isTidToLinkMappingNegotiationSupported

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTidToLinkMappingNegotiationSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports TID-To-Link Mapping Negotiation. <br /> |

### isTlsMinimumVersionSupported

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTlsMinimumVersionSupported ()
```

Indicate that whether or not settings required TLS minimum version is supported. If the device doesn't support this capability, the minimum accepted TLS version is 1.0.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports setting TLS minimum version. <br /> |

### isTlsV13Supported

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTlsV13Supported ()
```

Indicate that whether or not TLS v1.3 is supported. If requested minimum is not supported, it will default to the maximum supported version.

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports TLS v1.3. <br /> |

### isTrustOnFirstUseSupported

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTrustOnFirstUseSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Trust On First Use (TOFU). <br /> |

### isWapiSupported

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWapiSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports WAPI. <br /> |

### isWepSupported

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWepSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports connections to Wi-Fi WEP networks. <br /> |

### isWifiDisplayR2Supported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWifiDisplayR2Supported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports Wi-Fi Display R2. <br /> |

### isWifiEnabled

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWifiEnabled ()
```

Return whether Wi-Fi is enabled or disabled.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if Wi-Fi is enabled <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#getWifiState()`

### isWifiPasspointEnabled

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWifiPasspointEnabled ()
```

If the device supports Wi-Fi Passpoint, the user can explicitly enable or disable it. That status can be queried using this method.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Returns ||
|---|---|
| `boolean` | `true` if Wi-Fi Passpoint is enabled <br /> |

### isWifiStandardSupported

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWifiStandardSupported (int standard)
```

Check if the chipset supports a certain Wi-Fi standard.

<br />

| Parameters ||
|---|---|
| `standard` | `int`: the IEEE 802.11 standard to check on. valid values from `https://developer.android.com/reference/android/net/wifi/ScanResult`'s `WIFI_STANDARD_` Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_UNKNOWN` - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_LEGACY` - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_11N` - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_11AC` - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_11AX` - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_11AD` - `https://developer.android.com/reference/android/net/wifi/ScanResult#WIFI_STANDARD_11BE` |

| Returns ||
|---|---|
| `boolean` | `true` if supported, `false` otherwise. <br /> |

### isWpa3SaeH2eSupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWpa3SaeH2eSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports WPA3 SAE Hash-to-Element. <br /> |

### isWpa3SaePublicKeySupported

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWpa3SaePublicKeySupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports WPA3 SAE Public Key. <br /> |

### isWpa3SaeSupported

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWpa3SaeSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports WPA3-Personal SAE <br /> |

### isWpa3SuiteBSupported

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWpa3SuiteBSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports WPA3-Enterprise Suite-B-192 <br /> |

### isWpaPersonalSupported

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isWpaPersonalSupported ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this device supports connections to Wi-Fi WPA-Personal networks. Note that this is the older and less secure WPA-Personal protocol, not WPA2-Personal or later protocols. <br /> |

### pingSupplicant

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean pingSupplicant ()
```

<br />

**This method was deprecated in API level 26.**   

Will return the output of `https://developer.android.com/reference/android/net/wifi/WifiManager#isWifiEnabled()` instead.

Check that the supplicant daemon is responding to requests.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if we were able to communicate with the supplicant and it returned the expected response to the PING message. <br /> |

### queryAutojoinGlobal

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void queryAutojoinGlobal (Executor executor, 
                Consumer<Boolean> resultsCallback)
```

Query whether or not auto-join global is enabled/disabled

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return `Boolean` indicating whether auto-join global is enabled/disabled. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |
| `https://developer.android.com/reference/java/lang/SecurityException` | if the caller does not have permission. |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#allowAutojoinGlobal(boolean)`

### querySendDhcpHostnameRestriction

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void querySendDhcpHostnameRestriction (Executor executor, 
                IntConsumer resultsCallback)
```

Query the global restriction on which networks to send the device hostname to during DHCP.   

Requires `https://developer.android.com/` or `https://developer.android.com/`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `IntConsumer`: An asynchronous callback that will return a bitmask of `https://developer.android.com/`. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the calling app is not a Device Owner (DO), or a privileged app that has one of the permissions required by this API. |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#setSendDhcpHostnameRestriction(int)`

### reassociate

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean reassociate ()
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always return false.

Reconnect to the currently active access point, even if we are already connected. This may result in the asynchronous delivery of state change events.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded <br /> |

### reconnect

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean reconnect ()
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Reconnect to the currently active access point, if we are currently disconnected. This may result in the asynchronous delivery of state change events.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded <br /> |

### registerScanResultsCallback

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerScanResultsCallback (Executor executor, 
                WifiManager.ScanResultsCallback callback)
```

Register a callback for Scan Results. See `https://developer.android.com/reference/android/net/wifi/WifiManager.ScanResultsCallback`. Caller will receive the event when scan results are available. Caller should use `https://developer.android.com/reference/android/net/wifi/WifiManager#getScanResults()` requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` to get the scan results. Caller can remove a previously registered callback using `https://developer.android.com/reference/android/net/wifi/WifiManager#unregisterScanResultsCallback(android.net.wifi.WifiManager.ScanResultsCallback)` Same caller can add multiple listeners.

Applications should have the `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE` permission. Callers without the permission will trigger a `https://developer.android.com/reference/java/lang/SecurityException`.

.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: The executor to execute the callback of the `callback` object. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `WifiManager.ScanResultsCallback`: callback for Scan Results events. This value cannot be `null`. <br /> |

### registerSubsystemRestartTrackingCallback

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerSubsystemRestartTrackingCallback (Executor executor, 
                WifiManager.SubsystemRestartTrackingCallback callback)
```

Registers a `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` to listen to Wi-Fi subsystem restarts. The subsystem may restart due to internal recovery mechanisms or via user action.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: Executor to execute callback on. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `WifiManager.SubsystemRestartTrackingCallback`: `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` to register. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiManager#unregisterSubsystemRestartTrackingCallback(android.net.wifi.WifiManager.SubsystemRestartTrackingCallback)`

### removeLocalOnlyConnectionFailureListener

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeLocalOnlyConnectionFailureListener (WifiManager.LocalOnlyConnectionFailureListener listener)
```

Allow callers to remove a previously registered listener. After calling this method, applications will no longer receive local-only connection events through that listener.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `listener` | `WifiManager.LocalOnlyConnectionFailureListener`: listener to remove. This value cannot be `null`. <br /> |

### removeNetwork

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean removeNetwork (int netId)
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Remove the specified network from the list of configured networks. This may result in the asynchronous delivery of state change events. Applications are not allowed to remove networks created by other applications.

<br />

| Parameters ||
|---|---|
| `netId` | `int`: the ID of the network as returned by `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)` or `https://developer.android.com/reference/android/net/wifi/WifiManager#getConfiguredNetworks()`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded <br /> |

### removeNetworkSuggestions

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int removeNetworkSuggestions (List<WifiNetworkSuggestion> networkSuggestions, 
                int action)
```

Remove some or all of the network suggestions that were previously provided by the app. If one of the suggestions being removed was used to establish connection to the current network, then the specified action will be executed. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` for a detailed explanation of the parameters. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#equals(java.lang.Object)` for the equivalence evaluation used.   

Requires `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `networkSuggestions` | `List`: List of network suggestions to be removed. Pass an empty list to remove all the previous suggestions provided by the app. This value cannot be `null`. <br /> |
| `action` | `int`: Desired action to execute after removing the suggestion. One of `ACTION_REMOVE_SUGGESTION_*` Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_LINGER` - `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_DISCONNECT` |

| Returns ||
|---|---|
| `int` | Status code for the operation. One of the `STATUS_NETWORK_SUGGESTIONS_*` values. Any matching suggestions are removed from the device and will not be considered for further connection attempts. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_SUCCESS` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_RESTRICTED_BY_ADMIN` |

### removeNetworkSuggestions

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int removeNetworkSuggestions (List<WifiNetworkSuggestion> networkSuggestions)
```

Remove some or all of the network suggestions that were previously provided by the app. If one of the suggestions being removed was used to establish connection to the current network, then the device will immediately disconnect from that network. This method is same as `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>,%20int)` with `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_DISCONNECT` See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` for a detailed explanation of the parameters. See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#equals(java.lang.Object)` for the equivalence evaluation used.

[removeNetworkSuggestions(List,int)](https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>,%20int)). An `action` of `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_REMOVE_SUGGESTION_DISCONNECT` is equivalent to the current behavior.   

Requires `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `networkSuggestions` | `List`: List of network suggestions to be removed. Pass an empty list to remove all the previous suggestions provided by the app. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | Status code for the operation. One of the `STATUS_NETWORK_SUGGESTIONS_*` values. Any matching suggestions are removed from the device and will not be considered for any further connection attempts. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_SUCCESS` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_INTERNAL` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_APP_DISALLOWED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_DUPLICATE` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_EXCEEDS_MAX_PER_APP` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_REMOVE_INVALID` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID` - `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_RESTRICTED_BY_ADMIN` |

### removeNonCallerConfiguredNetworks

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean removeNonCallerConfiguredNetworks ()
```

Remove all configured networks that were not created by the calling app. Can only be called by a Device Owner (DO) app.   

Requires `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE`

<br />

| Returns ||
|---|---|
| `boolean` | `true` if at least one network is removed, `false` otherwise <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the caller is not a Device Owner app |

### removePasspointConfiguration

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removePasspointConfiguration (String fqdn)
```

<br />

**This method was deprecated in API level 29.**   

This will be non-functional in a future release.   

Requires `android.Manifest.permission.NETWORK_SETTINGS` or `android.Manifest.permission.NETWORK_CARRIER_PROVISIONING`.

Remove the Passpoint configuration identified by its FQDN (Fully Qualified Domain Name) added by the caller.

<br />

| Parameters ||
|---|---|
| `fqdn` | `String`: The FQDN of the Passpoint configuration added by the caller to be removed <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if no configuration is associated with the given FQDN or Passpoint is not enabled on the device. |

### removePerSsidRoamingMode

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removePerSsidRoamingMode (WifiSsid ssid)
```

This API allows a privileged application to remove roaming mode policy configured using the `https://developer.android.com/reference/android/net/wifi/WifiManager#setPerSsidRoamingMode(android.net.wifi.WifiSsid,%20int)`. Available for Device Owner (DO) and profile owner of an organization owned device. Other apps require `android.Manifest.permission#NETWORK_SETTINGS` or `android.Manifest.permission#MANAGE_WIFI_NETWORK_SELECTION` permission.

<br />

| Parameters ||
|---|---|
| `ssid` | `WifiSsid`: SSID to be removed from the roaming mode policy. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided a null input. |
| `https://developer.android.com/reference/java/lang/SecurityException` | if caller does not have the required permission. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the API is not supported on this SDK version. |

### removeSuggestionConnectionStatusListener

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeSuggestionConnectionStatusListener (WifiManager.SuggestionConnectionStatusListener listener)
```

Allow callers to remove a previously registered listener. After calling this method, applications will no longer receive suggestion connection events through that listener.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `listener` | `WifiManager.SuggestionConnectionStatusListener`: listener to remove. This value cannot be `null`. <br /> |

### removeSuggestionUserApprovalStatusListener

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeSuggestionUserApprovalStatusListener (WifiManager.SuggestionUserApprovalStatusListener listener)
```

Allow callers to remove a previously registered listener using `https://developer.android.com/reference/android/net/wifi/WifiManager#addSuggestionUserApprovalStatusListener(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener)`. After calling this method, applications will no longer receive network suggestion user approval status change through that listener.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `listener` | `WifiManager.SuggestionUserApprovalStatusListener`: This value cannot be `null`. <br /> |

### removeWifiStateChangedListener

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeWifiStateChangedListener (WifiManager.WifiStateChangedListener listener)
```

Unregisters a WifiStateChangedListener from listening on the current Wi-Fi state.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `listener` | `WifiManager.WifiStateChangedListener`: WifiStateChangedListener to unregister. This value cannot be `null`. <br /> |

### reportCreateInterfaceImpact

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void reportCreateInterfaceImpact (int interfaceType, 
                boolean requireNewInterface, 
                Executor executor, 
                BiConsumer<Boolean, Set<WifiManager.InterfaceCreationImpact>> resultCallback)
```

Queries the framework to determine whether the specified interface can be created, and if so - what other interfaces would be torn down by the framework to allow this creation if it were requested. The result is returned via the specified `https://developer.android.com/reference/java/util/function/BiConsumer` callback which returns two arguments:
- First argument: a `boolean` - indicating whether or not the interface can be created.
- Second argument: a `Set<InterfaceCreationImpact>` - if the interface can be created (first argument is `true` then this is the set of interface types which will be removed and the packages which requested them. Possibly an empty set. If the first argument is `false`, then an empty set will be returned here.
- Interfaces, input and output, are specified using the `WIFI_INTERFACE_*` constants: `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_STA`, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_AP`, `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_AWARE`, or `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_DIRECT`.
- This method does not actually create the interface. That operation is handled by the framework when a particular service method is called. E.g. a Wi-Fi Direct interface may be created when various methods of `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager` are called, similarly for Wi-Fi Aware and `https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager`.
- Note: the information returned via this method is the current snapshot of the system. It may change due to actions of the framework or other apps.   
  Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_WIFI_INTERFACES` and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

| Parameters ||
|---|---|
| `interfaceType` | `int`: The interface type whose possible creation is being queried. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_STA` - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_AP` - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_AWARE` - `https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_INTERFACE_TYPE_DIRECT` |
| `requireNewInterface` | `boolean`: Indicates that the query is for a new interface of the specified type - an existing interface won't meet the query. Some operations (such as Wi-Fi Direct and Wi-Fi Aware are a shared resource and so may not need a new interface). <br /> |
| `executor` | `Executor`: An `https://developer.android.com/reference/java/util/concurrent/Executor` on which to return the result. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultCallback` | `BiConsumer`: The asynchronous callback which will return two argument: a `boolean` (whether the interface can be created), and a `Set<InterfaceCreationImpact>` (a set of `https://developer.android.com/reference/android/net/wifi/WifiManager.InterfaceCreationImpact`: interfaces which will be destroyed when the interface is created and the packages which requested them and thus may be impacted). This value cannot be `null`. <br /> |

### saveConfiguration

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean saveConfiguration ()
```

<br />

**This method was deprecated in API level 26.**   

There is no need to call this method - `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetwork(android.net.wifi.WifiConfiguration)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#updateNetwork(android.net.wifi.WifiConfiguration)` and `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetwork(int)` already persist the configurations automatically.

Tell the device to persist the current list of configured networks.

Note: It is possible for this method to change the network IDs of existing networks. You should assume the network IDs can be different after calling this method.

<br />

| Returns ||
|---|---|
| `boolean` | `false`. <br /> |

### setPerSsidRoamingMode

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setPerSsidRoamingMode (WifiSsid ssid, 
                int roamingMode)
```

This API allows a privileged application to set roaming mode per SSID. Available for Device Owner (DO) and profile owner of an organization owned device. Other apps require `android.Manifest.permission#NETWORK_SETTINGS` or `android.Manifest.permission#MANAGE_WIFI_NETWORK_SELECTION` permission.

<br />

| Parameters ||
|---|---|
| `ssid` | `WifiSsid`: SSID to be mapped to apply roaming policy. This value cannot be `null`. <br /> |
| `roamingMode` | `int`: One of the `ROAMING_MODE_` values. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#ROAMING_MODE_NONE` - `https://developer.android.com/reference/android/net/wifi/WifiManager#ROAMING_MODE_NORMAL` - `https://developer.android.com/reference/android/net/wifi/WifiManager#ROAMING_MODE_AGGRESSIVE` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input is invalid. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided a null input. |
| `https://developer.android.com/reference/java/lang/SecurityException` | if caller does not have the required permission. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if the API is not supported on this SDK version or `https://developer.android.com/reference/android/net/wifi/WifiManager#isAggressiveRoamingModeSupported()` returns false, but input roaming mode is `ROAMING_MODE_AGGRESSIVE`. |

### setSendDhcpHostnameRestriction

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSendDhcpHostnameRestriction (int restriction)
```

Sets the global restrictions on which networks to send the device hostname to during DHCP.   

Requires `https://developer.android.com/` or `https://developer.android.com/`

<br />

| Parameters ||
|---|---|
| `restriction` | `int`: Bitmask of `https://developer.android.com/`, or none to indicate no restriction. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/net/wifi/WifiManager#FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_OPEN` - `https://developer.android.com/reference/android/net/wifi/WifiManager#FLAG_SEND_DHCP_HOSTNAME_RESTRICTION_SECURE` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input is invalid |
| `https://developer.android.com/reference/java/lang/SecurityException` | if the calling app is not a Device Owner (DO), or a privileged app that has one of the permissions required by this API. |

### setTdlsEnabled

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTdlsEnabled (InetAddress remoteIPAddress, 
                boolean enable)
```

Enable/Disable TDLS on a specific local route.

TDLS enables two wireless endpoints to talk to each other directly without going through the access point that is managing the local network. It saves bandwidth and improves quality of the link.

This API enables/disables the option of using TDLS. If enabled, the underlying hardware is free to use TDLS or a hop through the access point. If disabled, existing TDLS session is torn down and hardware is restricted to use access point for transferring wireless packets. Default value for all routes is 'disabled', meaning restricted to use access point for transferring packets.

<br />

<br />

| Parameters ||
|---|---|
| `remoteIPAddress` | `InetAddress`: IP address of the endpoint to setup TDLS with <br /> |
| `enable` | `boolean`: true = setup and false = tear down TDLS <br /> |

### setTdlsEnabled

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTdlsEnabled (InetAddress remoteIPAddress, 
                boolean enable, 
                Executor executor, 
                Consumer<Boolean> resultsCallback)
```

Enable/Disable TDLS on a specific local route. Similar to `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)`, except this version sends the result of the Enable/Disable request.

<br />

| Parameters ||
|---|---|
| `remoteIPAddress` | `InetAddress`: IP address of the endpoint to setup TDLS with. This value cannot be `null`. <br /> |
| `enable` | `boolean`: true = setup and false = tear down TDLS <br /> |
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return `Boolean` indicating whether TDLS was successfully enabled or disabled. `true` for success, `false` for failure. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |

### setTdlsEnabledWithMacAddress

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTdlsEnabledWithMacAddress (String remoteMacAddress, 
                boolean enable, 
                Executor executor, 
                Consumer<Boolean> resultsCallback)
```

Enable/Disable TDLS with a specific peer Mac Address. Similar to `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabledWithMacAddress(java.lang.String,%20boolean)`, except this version sends the result of the Enable/Disable request.

<br />

| Parameters ||
|---|---|
| `remoteMacAddress` | `String`: Mac address of the endpoint to setup TDLS with. This value cannot be `null`. <br /> |
| `enable` | `boolean`: true = setup and false = tear down TDLS <br /> |
| `executor` | `Executor`: The executor on which callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `resultsCallback` | `Consumer`: An asynchronous callback that will return `Boolean` indicating whether TDLS was successfully enabled or disabled. `true` for success, `false` for failure. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the caller provided invalid inputs. |

### setTdlsEnabledWithMacAddress

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTdlsEnabledWithMacAddress (String remoteMacAddress, 
                boolean enable)
```

Similar to `https://developer.android.com/reference/android/net/wifi/WifiManager#setTdlsEnabled(java.net.InetAddress,%20boolean)`, except this version allows you to specify remote endpoint with a MAC address.

<br />

| Parameters ||
|---|---|
| `remoteMacAddress` | `String`: MAC address of the remote endpoint such as 00:00:0c:9f:f2:ab <br /> |
| `enable` | `boolean`: true = setup and false = tear down TDLS <br /> |

### setWifiEnabled

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean setWifiEnabled (boolean enabled)
```

<br />

**This method was deprecated in API level 29.**   

Starting with Build.VERSION_CODES#Q, applications are not allowed to enable/disable Wi-Fi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `false`. If apps are targeting an older SDK (`https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` or below), they can continue to use this API.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

Starting with `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, DO and a profile owner of an organization owned device may set a user restriction (DISALLOW_CHANGE_WIFI_STATE) to only allow DO/PO to use this API.

<br />

Enable or disable Wi-Fi.

Applications must have the `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE` permission to toggle wifi.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: `true` to enable, `false` to disable. <br /> |

| Returns ||
|---|---|
| `boolean` | `false` if the request cannot be satisfied; `true` indicates that wifi is either already in the requested state, or in progress toward the requested state. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the caller is missing required permissions. |

### startLocalOnlyHotspot

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startLocalOnlyHotspot (WifiManager.LocalOnlyHotspotCallback callback, 
                Handler handler)
```

Request a local only hotspot that an application can use to communicate between co-located devices connected to the created WiFi hotspot. The network created by this method will not have Internet access. Each application can make a single request for the hotspot, but multiple applications could be requesting the hotspot at the same time. When multiple applications have successfully registered concurrently, they will be sharing the underlying hotspot. `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation)` is called when the hotspot is ready for use by the application.

Each application can make a single active call to this method. The `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation)` callback supplies the requestor with a `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotReservation` that contains a `https://developer.android.com/reference/android/net/wifi/SoftApConfiguration` with the SSID, security type and credentials needed to connect to the hotspot. Communicating this information is up to the application.

If the LocalOnlyHotspot cannot be created, the `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onFailed(int)` method will be called. Example failures include errors bringing up the network or if there is an incompatible operating mode. For example, if the user is currently using Wifi Tethering to provide an upstream to another device, LocalOnlyHotspot may not start due to an incompatible mode. The possible error codes include: `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_NO_CHANNEL`, `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_GENERIC`, `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE` and `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED`.

Internally, requests will be tracked to prevent the hotspot from being torn down while apps are still using it. The `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotReservation` object passed in the `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation)` call should be closed when the LocalOnlyHotspot is no longer needed using `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotReservation#close()`. Since the hotspot may be shared among multiple applications, removing the final registered application request will trigger the hotspot teardown. This means that applications should not listen to broadcasts containing wifi state to determine if the hotspot was stopped after they are done using it. Additionally, once `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotReservation#close()` is called, applications will not receive callbacks of any kind.

Applications should be aware that the user may also stop the LocalOnlyHotspot through the Settings UI; it is not guaranteed to stay up as long as there is a requesting application. The requestors will be notified of this case via `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onStopped()`. Other cases may arise where the hotspot is torn down (Emergency mode, etc). Application developers should be aware that it can stop unexpectedly, but they will receive a notification if they have properly registered.

Applications should also be aware that this network will be shared with other applications. Applications are responsible for protecting their data on this network (e.g. TLS).

Applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` or later need to have the following permissions: `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE` and `https://developer.android.com/reference/android/Manifest.permission#NEARBY_WIFI_DEVICES`. Applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or prior SDK levels need to have the following permissions: `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE` and `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` Callers without the permissions will trigger a `https://developer.android.com/reference/java/lang/SecurityException`.

<br />

<br />

| Parameters ||
|---|---|
| `callback` | `WifiManager.LocalOnlyHotspotCallback`: LocalOnlyHotspotCallback for the application to receive updates about operating status. <br /> |
| `handler` | `Handler`: Handler to be used for callbacks. If the caller passes a null Handler, the main thread will be used. <br /> |

### startLocalOnlyHotspotWithConfiguration

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startLocalOnlyHotspotWithConfiguration (SoftApConfiguration config, 
                Executor executor, 
                WifiManager.LocalOnlyHotspotCallback callback)
```

Starts a local-only hotspot with a specific configuration applied. See `https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)`. Since custom configuration settings may be incompatible with each other, the hotspot started through this method cannot coexist with another hotspot created through `https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)`. If this is attempted, the first hotspot request wins and others receive `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#ERROR_GENERIC` through `https://developer.android.com/reference/android/net/wifi/WifiManager.LocalOnlyHotspotCallback#onFailed(int)`.   

Requires `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE` and `https://developer.android.com/reference/android/Manifest.permission#NEARBY_WIFI_DEVICES`

<br />

| Parameters ||
|---|---|
| `config` | `SoftApConfiguration`: Custom configuration for the hotspot. See `https://developer.android.com/reference/android/net/wifi/SoftApConfiguration`. This value cannot be `null`. <br /> |
| `executor` | `Executor`: Executor to run callback methods on. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `WifiManager.LocalOnlyHotspotCallback`: LocalOnlyHotspotCallback for the application to receive updates about operating status. This value cannot be `null`. <br /> |

### startScan

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean startScan ()
```

<br />

**This method was deprecated in API level 28.**   

The ability for apps to trigger scan requests will be removed in a future release.

Request a scan for access points. Returns immediately. The availability of the results is made known later by means of an asynchronous event sent on completion of the scan.

To initiate a Wi-Fi scan, declare the `https://developer.android.com/reference/android/Manifest.permission#CHANGE_WIFI_STATE` permission in the manifest, and perform these steps:

1. Invoke the following method: `((WifiManager) getSystemService(WIFI_SERVICE)).startScan()`
2. Register a BroadcastReceiver to listen to `SCAN_RESULTS_AVAILABLE_ACTION`.
3. When a broadcast is received, call: `((WifiManager) getSystemService(WIFI_SERVICE)).getScanResults()`

<br />

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the operation succeeded, i.e., the scan was initiated. <br /> |

### startWps

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startWps (WpsInfo config, 
                WifiManager.WpsCallback listener)
```

<br />

**This method was deprecated in API level 28.**   

This API is deprecated

WPS suport has been deprecated from Client mode and this method will immediately trigger `https://developer.android.com/reference/android/net/wifi/WifiManager.WpsCallback#onFailed(int)` with a generic error.

<br />

| Parameters ||
|---|---|
| `config` | `WpsInfo`: WPS configuration (does not support `https://developer.android.com/reference/android/net/wifi/WpsInfo#LABEL`) <br /> |
| `listener` | `WifiManager.WpsCallback`: for callbacks on success or failure. Can be null. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if the WifiManager instance needs to be initialized again |

### unregisterScanResultsCallback

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterScanResultsCallback (WifiManager.ScanResultsCallback callback)
```

Allow callers to unregister a previously registered callback. After calling this method, applications will no longer receive Scan Results events.   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `callback` | `WifiManager.ScanResultsCallback`: callback to unregister for Scan Results events. This value cannot be `null`. <br /> |

### unregisterSubsystemRestartTrackingCallback

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterSubsystemRestartTrackingCallback (WifiManager.SubsystemRestartTrackingCallback callback)
```

Unregisters a `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` registered with `https://developer.android.com/reference/android/net/wifi/WifiManager#registerSubsystemRestartTrackingCallback(java.util.concurrent.Executor,%20android.net.wifi.WifiManager.SubsystemRestartTrackingCallback)`   

Requires `https://developer.android.com/reference/android/Manifest.permission#ACCESS_WIFI_STATE`

<br />

| Parameters ||
|---|---|
| `callback` | `WifiManager.SubsystemRestartTrackingCallback`: `https://developer.android.com/reference/android/net/wifi/WifiManager.SubsystemRestartTrackingCallback` to unregister. This value cannot be `null`. <br /> |

### updateNetwork

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int updateNetwork (WifiConfiguration config)
```

<br />

**This method was deprecated in API level 29.**   

a) See `https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build()` for new mechanism to trigger connection to a Wi-Fi network. b) See `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`, `https://developer.android.com/reference/android/net/wifi/WifiManager#removeNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)` for new API to add Wi-Fi networks for consideration when auto-connecting to wifi. **Compatibility Note:** For applications targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or above, this API will always fail and return `-1`.

Deprecation Exemptions:

- Device Owner (DO), Profile Owner (PO) and system apps.

<br />

Update the network description of an existing configured network.

<br />

| Parameters ||
|---|---|
| `config` | `WifiConfiguration`: the set of variables that describe the configuration, contained in a `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` object. It may be sparse, so that only the items that are being changed are non-`null`. The `networkId` field must be set to the ID of the existing network being updated. If the `https://developer.android.com/reference/android/net/wifi/WifiConfiguration` has an Http Proxy set the calling app must be System, or be provisioned as the Profile or Device Owner. <br /> |

| Returns ||
|---|---|
| `int` | Returns the `networkId` of the supplied `WifiConfiguration` on success. Returns `-1` on failure, including when the `networkId` field of the `WifiConfiguration` does not refer to an existing network. <br /> |

### validateSoftApConfiguration

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean validateSoftApConfiguration (SoftApConfiguration config)
```

Check if input configuration is valid.

This will return `false` if a non-null BSSID is set but the caller does not have any of

- `https://developer.android.com/`
- `https://developer.android.com/`
- `https://developer.android.com/`

<br />

<br />

| Parameters ||
|---|---|
| `config` | `SoftApConfiguration`: a configuration would like to be checked. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | true if config is valid, otherwise false. <br /> |