Android11 WiFi related code change record

Android11 ​​has been released, and the WiFi-related code has not changed much. Record it here to facilitate future development.

WifiConfiguration
new constructor: WifiConfiguration(WifiConfiguration)
new method: String getKey() returns a string that can be used to uniquely identify this WifiConfiguration, ssid+security type
void setSecurityParams(int) Set various security parameters to the provided security Type corresponding.
New variables: int SECURITY_TYPE_EAP
int SECURITY_TYPE_EAP_SUITE_B
int SECURITY_TYPE_OPEN
int SECURITY_TYPE_OWE
int SECURITY_TYPE_PSK
int SECURITY_TYPE_SAE
int SECURITY_TYPE_WAPI_CERT
int SECURITY_TYPE_WAPI_CERT
int SECURITY_TYPE_WAPI_PSK int SECURITY_TYPE_WAPI_WEP

ScanResult
new constructor: ScanResult() Constructs an empty scan result
ScanResult(ScanResult) This value cannot be empty.
New method: List getInformationElements() Get all the information elements found in the beacon.
int getWifiStandard() Returns the AP wifi standard.
New variable: CreatorScanResult CREATOR implements wrapperable interface
int WIFI_STANDARD_11AC
int WIFI_STANDARD_11AX
int WIFI_STANDARD_11N
int WIFI_STANDARD_LEGACY
int WIFI_STANDARD_UNKNOWN


New variable in WifiConfiguration.AuthAlgorithm : int SAE (only for WPA3-Personal)


New variable in WifiConfiguration.GroupCipher : int SMS4 = 6; SMS4 encryption algorithm of WAPI


New variables in WifiConfiguration.PairwiseCipher : int SMS4 = 4; SMS4 encryption algorithm of WAPI

WifiConfiguration.Protocol
new constructor: int WAPI added security protocol WAPI


New method in WifiEnterpriseConfig : PrivateKey getClientPrivateKey() Get the client private key provided in setClientKeyEntryWithCertificateChain
boolean isAuthenticationSimBased() Determine whether the configured authentication method is based on the utility method of the SIM card.
New variable: String EXTRA_WAPI_AS_CERTIFICATE_DATANAME
EXTRA_WAPI_USER_CERTIFICATE_DATA_USER
EXTRA_WAPI_USER_CERTIFICATE_DATA_USER
EXTRA_WAPI_USER
String_CERTIFICATE String_CERTIFICATE
String WAPI_USER_CERTIFICATE

WifiEnterpriseConfig.Eap
new variable: int WAPI_CERT

WifiInfo
new method: int getMaxSupportedRxLinkSpeedMbps() returns the maximum supported receiving link speed (in Mbps)
int getMaxSupportedTxLinkSpeedMbps() returns the maximum supported transmission link speed in Mbps
int getWifiStandard() Gets the connection Wi-Fi standard ( Protocol standard)


New method of WifiManager : void addSuggestionConnectionStatusListener(Executor, SuggestionConnectionStatusListener) to add a listener to the suggestion network. When the proposed network connection fails, the caller will receive an event. Callers can use WifiManager#removeSuggestionConnectionStatusListener (RecommendationionConnectionStatusListener) to remove previously registered listeners. The same caller can add multiple listeners to monitor events.
int calculateSignalLevel(int) Given the original RSSI, please use the system default RSSI quality level threshold to return the RSSI signal quality level.
int getMaxSignalLevel() Get the default maximum signal level of the system. This is the maximum RSSI level returned by calculateSignalLevel(int).
List getNetworkSuggestions() Get all network suggestions provided by the calling application.
boolean is6GHzBandSupported() Checks whether the chipset supports the 6GHz band.
boolean isAutoWakeupEnabled() Get the persistent Wi-Fi automatic wakeup function status. Unless the user changes it through "Settings", the default is false
boolean isScanThrottleEnabled() to obtain the persistent Wi-Fi scan throttling status. Unless the user changes through the developer options, the default is true.
boolean isStaApConcurrencySupported() Query whether the device supports station (STA) + access point (AP) concurrency.
boolean isWapiSupported() True if this device supports WAPI.
boolean isWifiStandardSupported(int) Check whether the chipset supports a certain Wi-Fi standard
void registerScanResultsCallback(Executor, ScanResultsCallback) Register the callback of the scan result. See ScanResultsCallback. When the scan results are available, the caller will receive the event.
void removeSuggestionConnectionStatusListener(SuggestionConnectionStatusListener) Allows the caller to remove previously registered listeners. After calling this method, the application will no longer receive suggested connection events through this listener.
void unregisterScanResultsCallback(ScanResultsCallback) Allows the caller to unregister previously registered callbacks. After calling this method, the application will no longer receive scan result events.
Changed method: int calculateSignalLevel(int, int) calculates the signal level. This function should be used whenever a signal is displayed.
New variable: String ACTION_WIFI_SCAN_AVAILABILITY_CHANGED
String EXTRA_SCAN_AVAILABLE
int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_INVALID
int STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED
int STATUS_SUGGESTION_CONNECTION_FAILURE_ASSOCIATION
int STATUS_SUGGESTION_CONNECTION_FAILURE_AUTHENTICATION
int STATUS_SUGGESTION_CONNECTION_FAILURE_IP_PROVISIONING
int STATUS_SUGGESTION_CONNECTION_FAILURE_UNKNOWN
String UNKNOWN_SSID

WifiManager.LocalOnlyHotspotReservation
new method: SoftApConfiguration getSoftApConfiguration () returns the current SoftApConfiguration only local hotspots (LOHS) of.
Changed method: WifiConfiguration getWifiConfiguration() returns the current Wifi configuration of local hotspot only (LOHS).

WifiNetworkSuggestion
新增方法:MacAddress getBssid()
WifiEnterpriseConfig getEnterpriseConfig()
String getPassphrase()
PasspointConfiguration getPasspointConfig()
int getPriority()
String getSsid()
boolean isAppInteractionRequired()
boolean isCredentialSharedWithUser()
boolean isEnhancedOpen()
boolean isHiddenSsid()
boolean isInitialAutojoinEnabled()
boolean isMetered()
boolean isUntrusted()
boolean isUserInteractionRequired()

WifiNetworkSuggestion.Builder
new method: Builder setCredentialSharedWithUser(boolean) Specify whether the user can use the network credentials provided by this recommendation to explicitly (manually) connect to the network. If true, the network will appear in the Wi-Fi Picker (in "Settings"), and the user will be able to use the provided credentials to select and connect to the network. If false, the user will need to enter network credentials, and the resulting configuration will become the user's saved network.
Builder setIsInitialAutojoinEnabled(boolean) Specifies whether to enable or disable auto-join when creating suggestions. Once the device is associated with the network, the user can directly modify the suggested auto-join configuration.
Builder setPasspointConfig(PasspointConfiguration) Set the Passpoint configuration associated with this network. Required for authentication to the Hotspot 2.0 network
Builder setUntrusted(boolean) Specifies whether the system starts the network in an untrusted manner (if selected).
Builder setWapiEnterpriseConfig(WifiEnterpriseConfig) Set the enterprise configuration associated with this network. Required for authentication to WAPI-CERT network.
Builder setWapiPassphrase(String) Set the ASCII WAPI password for this network. Required for authentication to WAPI-PSK network

Guess you like

Origin blog.csdn.net/qq_43804080/article/details/112602931