public class WifiConfiguration extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
WifiConfiguration.AuthAlgorithm
Recognized IEEE 802.11 authentication algorithms.
|
static class |
WifiConfiguration.GroupCipher
Recognized group ciphers.
|
static class |
WifiConfiguration.KeyMgmt
Recognized key management schemes.
|
static class |
WifiConfiguration.NetworkSelectionStatus |
static class |
WifiConfiguration.PairwiseCipher
Recognized pairwise ciphers for WPA.
|
static class |
WifiConfiguration.Protocol
Recognized security protocols.
|
static class |
WifiConfiguration.Status
Possible status of a network configuration.
|
static class |
WifiConfiguration.Visibility |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
BitSet |
allowedAuthAlgorithms
The set of authentication protocols supported by this configuration.
|
BitSet |
allowedGroupCiphers
The set of group ciphers supported by this configuration.
|
BitSet |
allowedKeyManagement
The set of key management protocols supported by this configuration.
|
BitSet |
allowedPairwiseCiphers
The set of pairwise ciphers for WPA supported by this configuration.
|
BitSet |
allowedProtocols
The set of security protocols supported by this configuration.
|
static int |
AP_BAND_2GHZ
2GHz band.
|
static int |
AP_BAND_5GHZ
5GHz band.
|
int |
apBand
The band which AP resides on
0-2G 1-5G
By default, 2G is chosen
|
int |
apChannel
The channel which AP resides on,currently, US only
2G 1-11
5G 36,40,44,48,149,153,157,161,165
0 - find a random available channel according to the apBand
|
String |
BSSID
When set, this network configuration entry should only be used when
associating with the AP having the specified BSSID.
|
static String |
bssidVarName |
String |
creationTime |
static Parcelable.Creator<WifiConfiguration> |
CREATOR
Implement the Parcelable interface
|
String |
creatorName |
int |
creatorUid |
String |
defaultGwMacAddress |
String |
dhcpServer |
boolean |
didSelfAdd
Set if the configuration was self added by the framework
This boolean is set once and never cleared.
|
int |
dtimInterval |
WifiEnterpriseConfig |
enterpriseConfig
The enterprise configuration details specifying the EAP method,
certificates and other settings associated with the EAP.
|
boolean |
ephemeral |
String |
FQDN
Fully qualified domain name of a passpoint configuration
|
boolean |
hiddenSSID
This is a network that does not broadcast its SSID, so an
SSID-specific probe request must be used for scans.
|
static String |
hiddenSSIDVarName |
static int |
HOME_NETWORK_RSSI_BOOST |
static int |
INVALID_NETWORK_ID |
static int |
INVALID_RSSI |
long |
lastConnected |
long |
lastConnectionFailure |
int |
lastConnectUid |
long |
lastDisconnected |
String |
lastFailure |
long |
lastRoamingFailure |
int |
lastRoamingFailureReason |
String |
lastUpdateName |
int |
lastUpdateUid |
HashMap<String,Integer> |
linkedConfigurations |
boolean |
meteredHint |
int |
networkId
The ID number that the supplicant uses to identify this
network configuration entry.
|
boolean |
noInternetAccessExpected
The WiFi configuration is expected not to have Internet access (e.g., a wireless printer, a
Chromecast hotspot, etc.).
|
int |
numAssociation |
int |
numNoInternetAccessReports |
int |
numScorerOverride |
int |
numScorerOverrideAndSwitchedNetwork |
int |
numTicksAtBadRSSI |
int |
numTicksAtLowRSSI |
int |
numTicksAtNotHighRSSI |
int |
numUserTriggeredJoinAttempts |
int |
numUserTriggeredWifiDisableBadRSSI |
int |
numUserTriggeredWifiDisableLowRSSI |
int |
numUserTriggeredWifiDisableNotHighRSSI |
String |
peerWifiConfiguration
Peer WifiConfiguration this WifiConfiguration was added for
|
static String |
pmfVarName |
String |
preSharedKey
Pre-shared key for use with WPA-PSK.
|
int |
priority
Priority determines the preference given to a network by
wpa_supplicant
when choosing an access point with which to associate. |
static String |
priorityVarName |
String |
providerFriendlyName
Name of passpoint credential provider
|
static String |
pskVarName |
boolean |
requirePMF
This is a network that requries Protected Management Frames (PMF).
|
static int |
ROAMING_FAILURE_AUTH_FAILURE |
static int |
ROAMING_FAILURE_IP_CONFIG |
long[] |
roamingConsortiumIds
Roaming Consortium Id list for passpoint credential; identifies a set of networks where
passpoint credential will be considered valid
|
long |
roamingFailureBlackListTimeMilli |
boolean |
selfAdded
Set if the configuration was self added by the framework
This boolean is cleared if we get a connect/save/ update or
any wifiManager command that indicate the user interacted with the configuration
since we will now consider that the configuration belong to him.
|
boolean |
shared |
String |
SSID
The network's SSID.
|
static String |
ssidVarName |
int |
status
The current status of this network configuration entry.
|
static int |
UNKNOWN_UID |
static String |
updateIdentiferVarName |
String |
updateIdentifier
Update identifier, for Passpoint network.
|
String |
updateTime |
boolean |
useExternalScores |
static int |
USER_APPROVED |
static int |
USER_BANNED |
static int |
USER_PENDING |
static int |
USER_UNSPECIFIED |
int |
userApproved |
boolean |
validatedInternetAccess |
WifiConfiguration.Visibility |
visibility |
String[] |
wepKeys
Up to four WEP keys.
|
static String[] |
wepKeyVarNames |
static String |
wepTxKeyIdxVarName |
int |
wepTxKeyIndex
Default WEP key index, ranging from 0 to 3.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
WifiConfiguration() |
WifiConfiguration(WifiConfiguration source)
copy constructor
|
public static final String ssidVarName
public static final String bssidVarName
public static final String pskVarName
public static final String[] wepKeyVarNames
public static final String wepTxKeyIdxVarName
public static final String priorityVarName
public static final String hiddenSSIDVarName
public static final String pmfVarName
public static final String updateIdentiferVarName
public static final int INVALID_NETWORK_ID
public static final int UNKNOWN_UID
public int networkId
public int status
WifiConfiguration.Status
public String SSID
"MyNetwork"
, or a string of
hex digits,which are not enclosed in quotes
(e.g., 01a243f405
).public String BSSID
XX:XX:XX:XX:XX:XX
where each X
is a hex digit.public static final int AP_BAND_2GHZ
public static final int AP_BAND_5GHZ
public int apBand
public int apChannel
public String preSharedKey
public String[] wepKeys
"abcdef"
or a string
of hex digits (e.g., 0102030405
).
When the value of one of these keys is read, the actual key is
not returned, just a "*" if the key has a value, or the null
string otherwise.public int wepTxKeyIndex
public int priority
wpa_supplicant
when choosing an access point with which to associate.public boolean hiddenSSID
public boolean requirePMF
public String updateIdentifier
public BitSet allowedKeyManagement
WifiConfiguration.KeyMgmt
for descriptions of the values.
Defaults to WPA-PSK WPA-EAP.public BitSet allowedProtocols
WifiConfiguration.Protocol
for descriptions of the values.
Defaults to WPA RSN.public BitSet allowedAuthAlgorithms
WifiConfiguration.AuthAlgorithm
for descriptions of the values.
Defaults to automatic selection.public BitSet allowedPairwiseCiphers
WifiConfiguration.PairwiseCipher
for descriptions of the values.
Defaults to CCMP TKIP.public BitSet allowedGroupCiphers
WifiConfiguration.GroupCipher
for descriptions of the values.
Defaults to CCMP TKIP WEP104 WEP40.public WifiEnterpriseConfig enterpriseConfig
public String FQDN
public String providerFriendlyName
public long[] roamingConsortiumIds
public boolean shared
public String dhcpServer
public String defaultGwMacAddress
public String lastFailure
public boolean validatedInternetAccess
public int dtimInterval
public int creatorUid
public int lastConnectUid
public int lastUpdateUid
public String creatorName
public String lastUpdateName
public int userApproved
public static int INVALID_RSSI
public WifiConfiguration.Visibility visibility
public static final int USER_UNSPECIFIED
public static final int USER_APPROVED
public static final int USER_BANNED
public static final int USER_PENDING
public int numNoInternetAccessReports
public String updateTime
public String creationTime
public boolean noInternetAccessExpected
public long lastConnected
public long lastConnectionFailure
public long lastRoamingFailure
public static int ROAMING_FAILURE_IP_CONFIG
public static int ROAMING_FAILURE_AUTH_FAILURE
public long roamingFailureBlackListTimeMilli
public int lastRoamingFailureReason
public long lastDisconnected
public boolean selfAdded
public boolean didSelfAdd
public String peerWifiConfiguration
public boolean ephemeral
public boolean meteredHint
public boolean useExternalScores
public int numScorerOverride
public int numScorerOverrideAndSwitchedNetwork
public int numAssociation
public int numUserTriggeredWifiDisableLowRSSI
public int numUserTriggeredWifiDisableBadRSSI
public int numUserTriggeredWifiDisableNotHighRSSI
public int numTicksAtLowRSSI
public int numTicksAtBadRSSI
public int numTicksAtNotHighRSSI
public int numUserTriggeredJoinAttempts
public static final int HOME_NETWORK_RSSI_BOOST
public static final Parcelable.Creator<WifiConfiguration> CREATOR
public WifiConfiguration()
public WifiConfiguration(WifiConfiguration source)
public void setVisibility(WifiConfiguration.Visibility status)
public boolean hasNoInternetAccess()
public WifiConfiguration.NetworkSelectionStatus getNetworkSelectionStatus()
public boolean isPasspoint()
public boolean isLinked(WifiConfiguration config)
public boolean isEnterprise()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public String getPrintableSsid()
public static String userApprovedAsString(int userApproved)
public String getKeyIdForCredentials(WifiConfiguration current)
current
- configuration contains values for additional fields
that are not part of this configuration. Used
when a config with some fields is passed by an application.IllegalStateException
- if config is invalid for key id generationpublic int getAuthType()
public String configKey(boolean allowCached)
public String configKey()
public IpConfiguration getIpConfiguration()
public void setIpConfiguration(IpConfiguration ipConfiguration)
public StaticIpConfiguration getStaticIpConfiguration()
public void setStaticIpConfiguration(StaticIpConfiguration staticIpConfiguration)
public IpConfiguration.IpAssignment getIpAssignment()
public void setIpAssignment(IpConfiguration.IpAssignment ipAssignment)
public IpConfiguration.ProxySettings getProxySettings()
public void setProxySettings(IpConfiguration.ProxySettings proxySettings)
public ProxyInfo getHttpProxy()
public void setHttpProxy(ProxyInfo httpProxy)
public void setProxy(IpConfiguration.ProxySettings settings, ProxyInfo proxy)
public int describeContents()
describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void setPasspointManagementObjectTree(String passpointManagementObjectTree)
public String getMoTree()
public void writeToParcel(Parcel dest, int flags)
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public byte[] getBytesForBackup() throws IOException
IOException
public static WifiConfiguration getWifiConfigFromBackup(DataInputStream in) throws IOException, BackupUtils.BadVersionException