WifiConfiguration
open classWifiConfiguration: Parcelable
kotlin.Any | |
↳ | android.net.wifi.WifiConfiguration |
A class representing a configured Wi-Fi network, including the security configuration.
Summary
Nested classes | |
---|---|
open |
Recognized IEEE 802. |
open |
Recognized group ciphers. |
open |
Recognized group management ciphers. |
open |
Recognized key management schemes. |
open |
Recognized pairwise ciphers for WPA. |
open |
Recognized security protocols. |
open |
Possible status of a network configuration. |
Constants | |
---|---|
static Int |
Let the wifi framework automatically decide the MAC randomization strategy. |
static Int |
Use factory MAC when connecting to this network |
static Int |
Use a randomly generated MAC address for connections to this network. |
static Int |
Generate a randomized MAC once and reuse it for all connections to this network |
static Int |
Security type for Easy Connect (DPP) network |
static Int |
Security type for an EAP network. |
static Int |
Security type for a WPA3-Enterprise in 192-bit security network. |
static Int |
Security type for a WPA3-Enterprise network. |
static Int |
Security type for a WPA3-Enterprise in 192-bit security network. |
static Int |
Security type for an open network. |
static Int |
Security type for an OWE network. |
static Int |
Security type for a PSK network. |
static Int |
Security type for an SAE network. |
static Int |
Security type for a WAPI Certificate network. |
static Int |
Security type for a WAPI PSK network. |
static Int |
Security type for a WEP network. |
Inherited constants | |
---|---|
Public constructors | |
---|---|
WifiConfiguration(source: WifiConfiguration) Copy constructor |
Public methods | |
---|---|
open Int |
Implement the Parcelable interface {@hide} |
open ProxyInfo! |
Returns the HTTP proxy used by this object. |
open String |
getKey() Return a String that can be used to uniquely identify this WifiConfiguration. |
open Int |
Get the MAC randomization setting for this network. |
open MacAddress |
Returns MAC address set to be the local randomized MAC address. |
open Boolean |
To check if this WifiConfiguration supports configuring a peer Enrollee device with SECURITY_TYPE_DPP |
open Boolean |
Identify if this configuration represents a Passpoint network |
open Unit |
setHttpProxy(httpProxy: ProxyInfo!) Set the |
open Unit |
setIpConfiguration(ipConfiguration: IpConfiguration?) Set the |
open Unit |
setMacRandomizationSetting(macRandomizationSetting: Int) Set the MAC randomization setting for this network. |
open Unit |
setSecurityParams(securityType: Int) Set the various security params to correspond to the provided security type. |
open String |
toString() |
open Unit |
writeToParcel(dest: Parcel, flags: Int) Implement the Parcelable interface {@hide} |
Properties | |
---|---|
String! |
When set, this network configuration entry should only be used when associating with the AP having the specified BSSID. |
String! |
Fully qualified domain name of a Passpoint configuration |
String! |
The network's SSID. |
BitSet |
The set of authentication protocols supported by this configuration. |
BitSet |
The set of group ciphers supported by this configuration. |
BitSet |
The set of group management ciphers supported by this configuration. |
BitSet |
The set of key management protocols supported by this configuration. |
BitSet |
The set of pairwise ciphers for WPA supported by this configuration. |
BitSet |
The set of security protocols supported by this configuration. |
BitSet |
The set of SuiteB ciphers supported by this configuration. |
WifiEnterpriseConfig! |
The enterprise configuration details specifying the EAP method, certificates and other settings associated with the EAP. |
Boolean |
This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans. |
Boolean |
Flag indicating if this network is provided by a home Passpoint provider or a roaming Passpoint provider. |
Int |
The ID number that the supplicant uses to identify this network configuration entry. |
String! |
Pre-shared key for use with WPA-PSK. |
Int |
Priority determines the preference given to a network by |
String! |
Name of Passpoint credential provider |
LongArray! |
Roaming Consortium Id list for Passpoint credential; identifies a set of networks where Passpoint credential will be considered valid |
Int |
The current status of this network configuration entry. |
Array<String!>! |
Four WEP keys. |
Int |
Default WEP key index, ranging from 0 to 3. |
Constants
RANDOMIZATION_AUTO
static valRANDOMIZATION_AUTO: Int
Deprecated: Deprecated in Java.
Let the wifi framework automatically decide the MAC randomization strategy.
Value: 3
RANDOMIZATION_NONE
static valRANDOMIZATION_NONE: Int
Deprecated: Deprecated in Java.
Use factory MAC when connecting to this network
Value: 0
RANDOMIZATION_NON_PERSISTENT
static valRANDOMIZATION_NON_PERSISTENT: Int
Deprecated: Deprecated in Java.
Use a randomly generated MAC address for connections to this network. This option does not persist the randomized MAC address.
Value: 2
RANDOMIZATION_PERSISTENT
static valRANDOMIZATION_PERSISTENT: Int
Deprecated: Deprecated in Java.
Generate a randomized MAC once and reuse it for all connections to this network
Value: 1
SECURITY_TYPE_DPP
static valSECURITY_TYPE_DPP: Int
Deprecated: Deprecated in Java.
Security type for Easy Connect (DPP) network
Value: 13
SECURITY_TYPE_EAP
static valSECURITY_TYPE_EAP: Int
Deprecated: Deprecated in Java.
Security type for an EAP network.
Value: 3
SECURITY_TYPE_EAP_SUITE_B
static valSECURITY_TYPE_EAP_SUITE_B: Int
Deprecated: Use the SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT
constant (which is the same value).
Security type for a WPA3-Enterprise in 192-bit security network.
Value: 5
SECURITY_TYPE_EAP_WPA3_ENTERPRISE
static valSECURITY_TYPE_EAP_WPA3_ENTERPRISE: Int
Deprecated: Deprecated in Java.
Security type for a WPA3-Enterprise network.
Value: 9
SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT
static valSECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT: Int
Deprecated: Deprecated in Java.
Security type for a WPA3-Enterprise in 192-bit security network. This is the same as SECURITY_TYPE_EAP_SUITE_B
and uses the same value.
Value: 5
SECURITY_TYPE_OPEN
static valSECURITY_TYPE_OPEN: Int
Deprecated: Deprecated in Java.
Security type for an open network.
Value: 0
SECURITY_TYPE_OWE
static valSECURITY_TYPE_OWE: Int
Deprecated: Deprecated in Java.
Security type for an OWE network.
Value: 6
SECURITY_TYPE_PSK
static valSECURITY_TYPE_PSK: Int
Deprecated: Deprecated in Java.
Security type for a PSK network.
Value: 2
SECURITY_TYPE_SAE
static valSECURITY_TYPE_SAE: Int
Deprecated: Deprecated in Java.
Security type for an SAE network.
Value: 4
SECURITY_TYPE_WAPI_CERT
static valSECURITY_TYPE_WAPI_CERT: Int
Deprecated: Deprecated in Java.
Security type for a WAPI Certificate network.
Value: 8
SECURITY_TYPE_WAPI_PSK
static valSECURITY_TYPE_WAPI_PSK: Int
Deprecated: Deprecated in Java.
Security type for a WAPI PSK network.
Value: 7
SECURITY_TYPE_WEP
static valSECURITY_TYPE_WEP: Int
Deprecated: Deprecated in Java.
Security type for a WEP network.
Value: 1
Public constructors
WifiConfiguration
WifiConfiguration(source: WifiConfiguration)
Copy constructor
Parameters | |
---|---|
source |
WifiConfiguration: This value cannot be null . |
Public methods
describeContents
open fundescribeContents(): Int
Deprecated: Deprecated in Java.
Implement the Parcelable interface {@hide}
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getHttpProxy
open fungetHttpProxy(): ProxyInfo!
Deprecated: Deprecated in Java.
Returns the HTTP proxy used by this object.
Return | |
---|---|
ProxyInfo! |
a httpProxy representing the proxy specified by this WifiConfiguration, or null if no proxy is specified. |
getKey
open fungetKey(): String
Deprecated: Deprecated in Java.
Return a String that can be used to uniquely identify this WifiConfiguration.
Note: Do not persist this value! This value is not guaranteed to remain backwards compatible.
Return | |
---|---|
String |
This value cannot be null . |
getMacRandomizationSetting
open fungetMacRandomizationSetting(): Int
Deprecated: Deprecated in Java.
Get the MAC randomization setting for this network.
getRandomizedMacAddress
open fungetRandomizedMacAddress(): MacAddress
Deprecated: Deprecated in Java.
Returns MAC address set to be the local randomized MAC address. Depending on user preference, the device may or may not use the returned MAC address for connections to this network.
Information is restricted to Device Owner, Profile Owner, and Carrier apps (which will only obtain addresses for configurations which they create). Other callers will receive a default "02:00:00:00:00:00" MAC address.
Return | |
---|---|
MacAddress |
This value cannot be null . |
isDppConfigurator
open funisDppConfigurator(): Boolean
Deprecated: Deprecated in Java.
To check if this WifiConfiguration supports configuring a peer Enrollee device with SECURITY_TYPE_DPP
isPasspoint
open funisPasspoint(): Boolean
Deprecated: Deprecated in Java.
Identify if this configuration represents a Passpoint network
setHttpProxy
open funsetHttpProxy(httpProxy: ProxyInfo!): Unit
Deprecated: Deprecated in Java.
Set the ProxyInfo
for this WifiConfiguration. This method should only be used by a device owner or profile owner. When other apps attempt to save a WifiConfiguration
with modified proxy settings, the methods WifiManager.addNetwork
and WifiManager.updateNetwork
fail and return -1
.
Parameters | |
---|---|
httpProxy |
ProxyInfo!: ProxyInfo representing the httpProxy to be used by this WifiConfiguration. Setting this to null will explicitly set no proxy, removing any proxy that was previously set. |
setIpConfiguration
open funsetIpConfiguration(ipConfiguration: IpConfiguration?): Unit
Deprecated: Deprecated in Java.
Set the IpConfiguration
for this network.
Parameters | |
---|---|
ipConfiguration |
IpConfiguration?: a IpConfiguration to use for this Wi-Fi configuration, or null to use the default configuration. |
setMacRandomizationSetting
open funsetMacRandomizationSetting(macRandomizationSetting: Int): Unit
Deprecated: Deprecated in Java.
Set the MAC randomization setting for this network.
Caller must satify one of the following conditions:
- Have
android.Manifest.permission#NETWORK_SETTINGS
permission. - Have
android.Manifest.permission#NETWORK_SETUP_WIZARD
permission. - Be in Demo Mode.
- Be the creator adding or updating a passpoint network.
- Be an admin updating their own network.
setSecurityParams
open funsetSecurityParams(securityType: Int): Unit
Deprecated: Deprecated in Java.
Set the various security params to correspond to the provided security type. This is accomplished by setting the various BitSets exposed in WifiConfiguration.
This API would clear existing security types and add a default one. Before calling this API with SECURITY_TYPE_DPP
as securityType, call android.net.wifi.WifiManager#isEasyConnectDppAkmSupported()
}
toString
open funtoString(): String
Deprecated: Deprecated in Java.
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
open funwriteToParcel(
dest: Parcel,
flags: Int
): Unit
Deprecated: Deprecated in Java.
Implement the Parcelable interface {@hide}
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
BSSID
varBSSID: String!
Deprecated: Deprecated in Java.
When set, this network configuration entry should only be used when associating with the AP having the specified BSSID. The value is a string in the format of an Ethernet MAC address, e.g., XX:XX:XX:XX:XX:XX
where each X
is a hex digit.
FQDN
varFQDN: String!
Deprecated: Deprecated in Java.
Fully qualified domain name of a Passpoint configuration
SSID
varSSID: String!
Deprecated: Deprecated in Java.
The network's SSID. Can either be a UTF-8 string, which must be enclosed in double quotation marks (e.g., "MyNetwork"
), or a string of hex digits, which are not enclosed in quotes (e.g., 01a243f405
).
allowedAuthAlgorithms
varallowedAuthAlgorithms: BitSet
Deprecated: Deprecated in Java.
The set of authentication protocols supported by this configuration. See AuthAlgorithm
for descriptions of the values. Defaults to automatic selection.
allowedGroupCiphers
varallowedGroupCiphers: BitSet
Deprecated: Deprecated in Java.
The set of group ciphers supported by this configuration. See GroupCipher
for descriptions of the values. Defaults to CCMP TKIP WEP104 WEP40.
allowedGroupManagementCiphers
varallowedGroupManagementCiphers: BitSet
Deprecated: Deprecated in Java.
The set of group management ciphers supported by this configuration. See GroupMgmtCipher
for descriptions of the values.
allowedKeyManagement
varallowedKeyManagement: BitSet
Deprecated: Deprecated in Java.
The set of key management protocols supported by this configuration. See KeyMgmt
for descriptions of the values. Defaults to WPA-PSK WPA-EAP.
allowedPairwiseCiphers
varallowedPairwiseCiphers: BitSet
Deprecated: Deprecated in Java.
The set of pairwise ciphers for WPA supported by this configuration. See PairwiseCipher
for descriptions of the values. Defaults to CCMP TKIP.
allowedProtocols
varallowedProtocols: BitSet
Deprecated: Deprecated in Java.
The set of security protocols supported by this configuration. See Protocol
for descriptions of the values. Defaults to WPA RSN.
allowedSuiteBCiphers
varallowedSuiteBCiphers: BitSet
Deprecated: Deprecated in Java.
The set of SuiteB ciphers supported by this configuration. To be used for WPA3-Enterprise mode. Set automatically by the framework based on the certificate type that is used in this configuration.
enterpriseConfig
varenterpriseConfig: WifiEnterpriseConfig!
Deprecated: Deprecated in Java.
The enterprise configuration details specifying the EAP method, certificates and other settings associated with the EAP.
hiddenSSID
varhiddenSSID: Boolean
Deprecated: Deprecated in Java.
This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans.
isHomeProviderNetwork
varisHomeProviderNetwork: Boolean
Deprecated: Deprecated in Java.
Flag indicating if this network is provided by a home Passpoint provider or a roaming Passpoint provider. This flag will be true
if this network is provided by a home Passpoint provider and false
if is provided by a roaming Passpoint provider or is a non-Passpoint network.
networkId
varnetworkId: Int
Deprecated: Deprecated in Java.
The ID number that the supplicant uses to identify this network configuration entry. This must be passed as an argument to most calls into the supplicant.
preSharedKey
varpreSharedKey: String!
Deprecated: Deprecated in Java.
Pre-shared key for use with WPA-PSK. Either an ASCII string enclosed in double quotation marks (e.g., "abcdefghij"
for PSK passphrase or a string of 64 hex digits for raw PSK.
priority
varpriority: Int
Deprecated: This field does not exist anymore.
Priority determines the preference given to a network by wpa_supplicant
when choosing an access point with which to associate.
providerFriendlyName
varproviderFriendlyName: String!
Deprecated: Deprecated in Java.
Name of Passpoint credential provider
roamingConsortiumIds
varroamingConsortiumIds: LongArray!
Deprecated: Deprecated in Java.
Roaming Consortium Id list for Passpoint credential; identifies a set of networks where Passpoint credential will be considered valid
status
varstatus: Int
Deprecated: Deprecated in Java.
The current status of this network configuration entry.
wepKeys
varwepKeys: Array<String!>!
Deprecated: Due to security and performance limitations, use of WEP networks is discouraged.
Four WEP keys. For each of the four values, provide either an ASCII string enclosed in double quotation marks (e.g., "abcdef"
) or a string of hex digits (e.g., 0102030405
).
wepTxKeyIndex
varwepTxKeyIndex: Int
Deprecated: Due to security and performance limitations, use of WEP networks is discouraged.
Default WEP key index, ranging from 0 to 3.