Builder
class Builder
kotlin.Any | |
↳ | android.net.wifi.WifiNetworkSuggestion.Builder |
Builder used to create WifiNetworkSuggestion
objects.
Summary
Public constructors | |
---|---|
Builder() |
Public methods | |
---|---|
WifiNetworkSuggestion |
build() Create a network suggestion object for use in |
WifiNetworkSuggestion.Builder |
setBssid(bssid: MacAddress) Set the BSSID to use for filtering networks from scan results. |
WifiNetworkSuggestion.Builder |
setCarrierMerged(isCarrierMerged: Boolean) Specifies whether the suggestion represents a carrier merged network. |
WifiNetworkSuggestion.Builder |
Specifies whether the network credentials provided with this suggestion can be used by the user to explicitly (manually) connect to this network. |
WifiNetworkSuggestion.Builder |
setIsAppInteractionRequired(isAppInteractionRequired: Boolean) Specifies whether the app needs to log in to a captive portal to obtain Internet access. |
WifiNetworkSuggestion.Builder |
setIsEnhancedOpen(isEnhancedOpen: Boolean) Specifies whether this represents an Enhanced Open (OWE) network. |
WifiNetworkSuggestion.Builder |
setIsHiddenSsid(isHiddenSsid: Boolean) Specifies whether this represents a hidden network. |
WifiNetworkSuggestion.Builder |
setIsInitialAutojoinEnabled(enabled: Boolean) Specifies whether the suggestion is created with auto-join enabled or disabled. |
WifiNetworkSuggestion.Builder |
setIsMetered(isMetered: Boolean) Specifies whether this network is metered. |
WifiNetworkSuggestion.Builder |
setIsUserInteractionRequired(isUserInteractionRequired: Boolean) Specifies whether the user needs to log in to a captive portal to obtain Internet access. |
WifiNetworkSuggestion.Builder |
setIsWpa3SaeH2eOnlyModeEnabled(enable: Boolean) Specifies whether the suggestion represents an SAE network which only accepts Hash-to-Element mode. |
WifiNetworkSuggestion.Builder |
setMacRandomizationSetting(macRandomizationSetting: Int) Specifies the MAC randomization method. |
WifiNetworkSuggestion.Builder |
setPasspointConfig(passpointConfig: PasspointConfiguration) Set the associated Passpoint configuration for this network. |
WifiNetworkSuggestion.Builder |
setPriority(priority: Int) Specify the priority of this network among other network suggestions provided by the same app and within the same priority group, see |
WifiNetworkSuggestion.Builder |
setPriorityGroup(priorityGroup: Int) Suggested networks are considered as part of a pool of all suggested networks and other networks (e.g. saved networks) - one of which will be selected. |
WifiNetworkSuggestion.Builder |
setRestricted(isRestricted: Boolean) Specifies whether the system will bring up the network (if selected) as restricted. |
WifiNetworkSuggestion.Builder |
Set the unicode SSID for the network. |
WifiNetworkSuggestion.Builder |
setSubscriptionGroup(groupUuid: ParcelUuid) Configure the suggestion to only be used with the SIMs that belong to the Subscription Group specified in this method. |
WifiNetworkSuggestion.Builder |
setSubscriptionId(subscriptionId: Int) Configure the suggestion to only be used with the SIM identified by the subscription ID specified in this method. |
WifiNetworkSuggestion.Builder |
setUntrusted(isUntrusted: Boolean) Specifies whether the system will bring up the network (if selected) as untrusted. |
WifiNetworkSuggestion.Builder |
setWapiEnterpriseConfig(enterpriseConfig: WifiEnterpriseConfig) Set the associated enterprise configuration for this network. |
WifiNetworkSuggestion.Builder |
setWapiPassphrase(passphrase: String) Set the ASCII WAPI passphrase for this network. |
WifiNetworkSuggestion.Builder |
setWifi7Enabled(enabled: Boolean) Sets whether Wi-Fi 7 is enabled for this network. |
WifiNetworkSuggestion.Builder |
setWifiSsid(wifiSsid: WifiSsid) Set the SSID for the network. |
WifiNetworkSuggestion.Builder |
setWpa2EnterpriseConfig(enterpriseConfig: WifiEnterpriseConfig) Set the associated enterprise configuration for this network. |
WifiNetworkSuggestion.Builder |
setWpa2Passphrase(passphrase: String) Set the ASCII WPA2 passphrase for this network. |
WifiNetworkSuggestion.Builder |
setWpa3Enterprise192BitModeConfig(enterpriseConfig: WifiEnterpriseConfig) Set the associated enterprise configuration for this network. |
WifiNetworkSuggestion.Builder |
setWpa3EnterpriseConfig(enterpriseConfig: WifiEnterpriseConfig) Set the associated enterprise configuration for this network. |
WifiNetworkSuggestion.Builder |
setWpa3EnterpriseStandardModeConfig(enterpriseConfig: WifiEnterpriseConfig) Set the associated enterprise configuration for this network. |
WifiNetworkSuggestion.Builder |
setWpa3Passphrase(passphrase: String) Set the ASCII WPA3 passphrase for this network. |
Public constructors
Public methods
build
fun build(): WifiNetworkSuggestion
Create a network suggestion object for use in WifiManager#addNetworkSuggestions(List)
.
Note: Apps can set a combination of SSID using setSsid(java.lang.String)
and BSSID using setBssid(android.net.MacAddress)
to provide more fine grained network suggestions to the platform.
<code>final WifiNetworkSuggestion suggestion1 = new Builder() .setSsid("test111111") .build(); final WifiNetworkSuggestion suggestion2 = new Builder() .setSsid("test222222") .setWpa2Passphrase("test123456") .build(); final WifiNetworkSuggestion suggestion3 = new Builder() .setSsid("test333333") .setWpa3Passphrase("test6789") .build(); final PasspointConfiguration passpointConfig= new PasspointConfiguration(); // configure passpointConfig to include a valid Passpoint configuration final WifiNetworkSuggestion suggestion4 = new Builder() .setPasspointConfig(passpointConfig) .build(); final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<WifiNetworkSuggestion> { { add(suggestion1); add(suggestion2); add(suggestion3); add(suggestion4); } }; final WifiManager wifiManager = context.getSystemService(Context.WIFI_SERVICE); wifiManager.addNetworkSuggestions(suggestionsList); // ... </code>
Return | |
---|---|
WifiNetworkSuggestion |
Instance of WifiNetworkSuggestion This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
on invalid params set |
setBssid
fun setBssid(bssid: MacAddress): WifiNetworkSuggestion.Builder
Set the BSSID to use for filtering networks from scan results. Will only match network whose BSSID is identical to the specified value.
setBssid(android.net.MacAddress)
.Parameters | |
---|---|
bssid |
MacAddress: BSSID of the network. This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setCarrierMerged
fun setCarrierMerged(isCarrierMerged: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the suggestion represents a carrier merged network. A carrier merged Wi-Fi network is treated as part of the mobile carrier network. Such configuration may impact the user interface and data usage accounting.
Only carriers with the android.telephony.CarrierConfigManager#KEY_CARRIER_PROVISIONS_WIFI_MERGED_NETWORKS_BOOL
flag set to true
may use this API.
Parameters | |
---|---|
isCarrierMerged |
Boolean: Boolean indicating whether the network is treated a carrier merged network (if true) or non-merged network (if false); |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setCredentialSharedWithUser
fun setCredentialSharedWithUser(: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the network credentials provided with this suggestion can be used by the user to explicitly (manually) connect to this network. If true this network will appear in the Wi-Fi Picker (in Settings) and the user will be able to select and connect to it with the provided credentials. If false, the user will need to enter network credentials and the resulting configuration will become a user saved network.
Parameters | |
---|---|
isShared |
Boolean: true to indicate that the credentials may be used by the user to manually connect to the network, false otherwise. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsAppInteractionRequired
fun setIsAppInteractionRequired(isAppInteractionRequired: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the app needs to log in to a captive portal to obtain Internet access.
This will dictate if the directed broadcast WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION
will be sent to the app after successfully connecting to the network. Use this for captive portal type networks where the app needs to authenticate the user before the device can access the network.
Parameters | |
---|---|
isAppInteractionRequired |
Boolean: true to indicate that app interaction is required, false otherwise. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsEnhancedOpen
fun setIsEnhancedOpen(isEnhancedOpen: Boolean): WifiNetworkSuggestion.Builder
Specifies whether this represents an Enhanced Open (OWE) network.
Parameters | |
---|---|
isEnhancedOpen |
Boolean: true to indicate that the network used enhanced open, false otherwise. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsHiddenSsid
fun setIsHiddenSsid(isHiddenSsid: Boolean): WifiNetworkSuggestion.Builder
Specifies whether this represents a hidden network.
Parameters | |
---|---|
isHiddenSsid |
Boolean: true to indicate that the network is hidden, false otherwise. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsInitialAutojoinEnabled
fun setIsInitialAutojoinEnabled(enabled: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the suggestion is created with auto-join enabled or disabled. The user may modify the auto-join configuration of a suggestion directly once the device associates to the network.
If auto-join is initialized as disabled the user may still be able to manually connect to the network. Therefore, disabling auto-join only makes sense if setCredentialSharedWithUser(boolean)
is set to true (the default) which itself implies a secure (non-open) network.
If not set, defaults to true (i.e. auto-join is initialized as enabled).
Parameters | |
---|---|
enabled |
Boolean: true for initializing with auto-join enabled (the default), false to initializing with auto-join disabled. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsMetered
fun setIsMetered(isMetered: Boolean): WifiNetworkSuggestion.Builder
Specifies whether this network is metered.
Parameters | |
---|---|
isMetered |
Boolean: true to indicate that the network is metered, false for not metered. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsUserInteractionRequired
fun setIsUserInteractionRequired(isUserInteractionRequired: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the user needs to log in to a captive portal to obtain Internet access.
Parameters | |
---|---|
isUserInteractionRequired |
Boolean: true to indicate that user interaction is required, false otherwise. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setIsWpa3SaeH2eOnlyModeEnabled
fun setIsWpa3SaeH2eOnlyModeEnabled(enable: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the suggestion represents an SAE network which only accepts Hash-to-Element mode. If this is enabled, Hunting & Pecking mode is disabled and only Hash-to-Element mode is used for this network. This is only valid for an SAE network which is configured using the setWpa3Passphrase
. Before calling this API, the application should check Hash-to-Element support using WifiManager#isWpa3SaeH2eSupported()
.
Parameters | |
---|---|
enable |
Boolean: Boolean indicating whether the network only accepts Hash-to-Element mode, default is false. |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setMacRandomizationSetting
fun setMacRandomizationSetting(macRandomizationSetting: Int): WifiNetworkSuggestion.Builder
Specifies the MAC randomization method.
Suggested networks will never use the device (factory) MAC address to associate to the network - instead they use a locally generated random MAC address. This method controls the strategy for generating the random MAC address. If not set, defaults to RANDOMIZATION_PERSISTENT
.
Parameters | |
---|---|
macRandomizationSetting |
Int: - one of RANDOMIZATION_* values Value is android.net.wifi.WifiNetworkSuggestion#RANDOMIZATION_PERSISTENT , or android.net.wifi.WifiNetworkSuggestion#RANDOMIZATION_NON_PERSISTENT |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setPasspointConfig
fun setPasspointConfig(passpointConfig: PasspointConfiguration): WifiNetworkSuggestion.Builder
Set the associated Passpoint configuration for this network. Needed for authenticating to Hotspot 2.0 networks. See PasspointConfiguration
for description.
Parameters | |
---|---|
passpointConfig |
PasspointConfiguration: Instance of PasspointConfiguration . This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if passpoint configuration is invalid. |
setPriority
fun setPriority(priority: Int): WifiNetworkSuggestion.Builder
Specify the priority of this network among other network suggestions provided by the same app and within the same priority group, see setPriorityGroup(int)
. Priorities have no impact on suggestions by other apps or suggestions from the same app using a different priority group. The higher the number, the higher the priority (i.e value of 0 = lowest priority). If not set, defaults to a lower priority than any assigned priority.
Parameters | |
---|---|
priority |
Int: Integer number representing the priority among suggestions by the app. Value is 0 or greater |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the priority value is negative. |
setPriorityGroup
fun setPriorityGroup(priorityGroup: Int): WifiNetworkSuggestion.Builder
Suggested networks are considered as part of a pool of all suggested networks and other networks (e.g. saved networks) - one of which will be selected.
- Any app can suggest any number of networks.
- Priority: only the highest priority (0 being the lowest) currently visible suggested network or networks (multiple suggested networks may have the same priority) are added to the network selection pool.
However, this restricts a suggesting app to have a single group of networks which can be prioritized. In some circumstances multiple groups are useful: for instance, suggesting networks for 2 different SIMs - each of which may have its own priority order.
Priority group: creates a separate priority group. Only the highest priority, currently visible suggested network or networks, within each priority group are included in the network selection pool.
Specify an arbitrary integer only used as the priority group. Use with setPriority(int)
.
Parameters | |
---|---|
priorityGroup |
Int: priority group id, if not set default is 0. Value is 0 or greater |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setRestricted
fun setRestricted(isRestricted: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the system will bring up the network (if selected) as restricted. A restricted network has its NetworkCapabilities#NET_CAPABILITY_NOT_RESTRICTED
capability removed. The Wi-Fi network selection process may use this information to influence priority of the suggested network for Wi-Fi network selection (most likely to reduce it). The connectivity service may use this information to influence the overall network configuration of the device.
NetworkRequest
without NetworkCapabilities#NET_CAPABILITY_NOT_RESTRICTED
capability is filed. setCredentialSharedWithUser(boolean)
.Parameters | |
---|---|
isRestricted |
Boolean: Boolean indicating whether the network should be brought up restricted (if true) or unrestricted (if false). |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setSsid
fun setSsid(ssid: String): WifiNetworkSuggestion.Builder
Set the unicode SSID for the network.
setSsid(java.lang.String)
. Note: use setWifiSsid(android.net.wifi.WifiSsid)
which supports both unicode and non-unicode SSID.
Parameters | |
---|---|
ssid |
String: The SSID of the network. It must be valid Unicode. This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the SSID is not valid unicode. |
setSubscriptionGroup
fun setSubscriptionGroup(groupUuid: ParcelUuid): WifiNetworkSuggestion.Builder
Configure the suggestion to only be used with the SIMs that belong to the Subscription Group specified in this method. The suggested network will only be used by the SIM in this Subscription Group and no other SIMs - even from the same carrier.
The caller is restricted to be either of:
TelephonyManager#hasCarrierPrivileges()
.
Specifying a subscription group which doesn't match these restriction will cause the suggestion to be rejected with the error code WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED
. Only one of the setSubscriptionGroup(android.os.ParcelUuid)
and setSubscriptionId(int)
should be called for a suggestion.
Parameters | |
---|---|
groupUuid |
ParcelUuid: Subscription group UUID see SubscriptionManager#createSubscriptionGroup(List) This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if group UUID is null . |
setSubscriptionId
fun setSubscriptionId(subscriptionId: Int): WifiNetworkSuggestion.Builder
Configure the suggestion to only be used with the SIM identified by the subscription ID specified in this method. The suggested network will only be used by that SIM and no other SIM - even from the same carrier.
The caller is restricted to be either of:
android.Manifest.permission#NETWORK_CARRIER_PROVISIONING
permission). TelephonyManager#hasCarrierPrivileges()
.
Specifying a subscription ID which doesn't match these restriction will cause the suggestion to be rejected with the error code WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED
. Only one of the setSubscriptionGroup(android.os.ParcelUuid)
and setSubscriptionId(int)
should be called for a suggestion.
Parameters | |
---|---|
subscriptionId |
Int: subscription ID see SubscriptionInfo#getSubscriptionId() |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if subscriptionId equals to SubscriptionManager#INVALID_SUBSCRIPTION_ID |
setUntrusted
fun setUntrusted(isUntrusted: Boolean): WifiNetworkSuggestion.Builder
Specifies whether the system will bring up the network (if selected) as untrusted. An untrusted network has its NetworkCapabilities#NET_CAPABILITY_TRUSTED
capability removed. The Wi-Fi network selection process may use this information to influence priority of the suggested network for Wi-Fi network selection (most likely to reduce it). The connectivity service may use this information to influence the overall network configuration of the device.
NetworkRequest
without NetworkCapabilities#NET_CAPABILITY_TRUSTED
capability is filed. setCredentialSharedWithUser(boolean)
.Parameters | |
---|---|
isUntrusted |
Boolean: Boolean indicating whether the network should be brought up untrusted (if true) or trusted (if false). |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setWapiEnterpriseConfig
fun setWapiEnterpriseConfig(enterpriseConfig: WifiEnterpriseConfig): WifiNetworkSuggestion.Builder
Set the associated enterprise configuration for this network. Needed for authenticating to WAPI-CERT networks. See WifiEnterpriseConfig
for description.
Parameters | |
---|---|
enterpriseConfig |
WifiEnterpriseConfig: Instance of WifiEnterpriseConfig . This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setWapiPassphrase
fun setWapiPassphrase(passphrase: String): WifiNetworkSuggestion.Builder
Set the ASCII WAPI passphrase for this network. Needed for authenticating to WAPI-PSK networks.
Parameters | |
---|---|
passphrase |
String: passphrase of the network. This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the passphrase is not ASCII encodable. |
setWifi7Enabled
fun setWifi7Enabled(enabled: Boolean): WifiNetworkSuggestion.Builder
Sets whether Wi-Fi 7 is enabled for this network.
Parameters | |
---|---|
enabled |
Boolean: Enable Wi-Fi 7 if true, otherwise disable Wi-Fi 7 |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
setWifiSsid
fun setWifiSsid(wifiSsid: WifiSsid): WifiNetworkSuggestion.Builder
Set the SSID for the network. WifiSsid
support both unicode and non-unicode SSID.
setWifiSsid(android.net.wifi.WifiSsid)
or setSsid(java.lang.String)
. Note: this method is the superset of the setSsid(java.lang.String)
Parameters | |
---|---|
wifiSsid |
WifiSsid: The SSID of the network, in WifiSsid format. This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the wifiSsid is invalid. |
setWpa2EnterpriseConfig
fun setWpa2EnterpriseConfig(enterpriseConfig: WifiEnterpriseConfig): WifiNetworkSuggestion.Builder
Set the associated enterprise configuration for this network. Needed for authenticating to WPA2 enterprise networks. See WifiEnterpriseConfig
for description.
Parameters | |
---|---|
enterpriseConfig |
WifiEnterpriseConfig: Instance of WifiEnterpriseConfig . This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
If configuration uses server certificate but validation is not enabled. See WifiEnterpriseConfig#isServerCertValidationEnabled() |
setWpa2Passphrase
fun setWpa2Passphrase(passphrase: String): WifiNetworkSuggestion.Builder
Set the ASCII WPA2 passphrase for this network. Needed for authenticating to WPA2-PSK networks.
Parameters | |
---|---|
passphrase |
String: passphrase of the network. This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the passphrase is not ASCII encodable. |
setWpa3Enterprise192BitModeConfig
fun setWpa3Enterprise192BitModeConfig(enterpriseConfig: WifiEnterpriseConfig): WifiNetworkSuggestion.Builder
Set the associated enterprise configuration for this network. Needed for authenticating to WPA3-Enterprise in 192-bit security mode networks. See WifiEnterpriseConfig
for description. Both the client and CA certificates must be provided, and must be of type of either sha384WithRSAEncryption with key length of 3072bit or more (OID 1.2.840.113549.1.1.12), or ecdsa-with-SHA384 with key length of 384bit or more (OID 1.2.840.10045.4.3.3).
Parameters | |
---|---|
enterpriseConfig |
WifiEnterpriseConfig: Instance of WifiEnterpriseConfig . This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the EAP type or certificates do not meet 192-bit mode requirements. |
setWpa3EnterpriseConfig
funsetWpa3EnterpriseConfig(enterpriseConfig: WifiEnterpriseConfig): WifiNetworkSuggestion.Builder
Deprecated: use setWpa3EnterpriseStandardModeConfig(android.net.wifi.WifiEnterpriseConfig)
or setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)
to specify WPA3-Enterprise type explicitly.
Set the associated enterprise configuration for this network. Needed for authenticating to WPA3-Enterprise networks (standard and 192-bit security). See WifiEnterpriseConfig
for description. For 192-bit security networks, both the client and CA certificates must be provided, and must be of type of either sha384WithRSAEncryption (OID 1.2.840.113549.1.1.12) or ecdsa-with-SHA384 (OID 1.2.840.10045.4.3.3).
Parameters | |
---|---|
enterpriseConfig |
WifiEnterpriseConfig: Instance of WifiEnterpriseConfig . This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
If configuration uses server certificate but validation is not enabled. See WifiEnterpriseConfig#isServerCertValidationEnabled() |
setWpa3EnterpriseStandardModeConfig
fun setWpa3EnterpriseStandardModeConfig(enterpriseConfig: WifiEnterpriseConfig): WifiNetworkSuggestion.Builder
Set the associated enterprise configuration for this network. Needed for authenticating to WPA3-Enterprise standard networks. See WifiEnterpriseConfig
for description. For WPA3-Enterprise in 192-bit security mode networks, see setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)
for description.
Parameters | |
---|---|
enterpriseConfig |
WifiEnterpriseConfig: Instance of WifiEnterpriseConfig . This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
If configuration uses server certificate but validation is not enabled. See WifiEnterpriseConfig#isServerCertValidationEnabled() |
setWpa3Passphrase
fun setWpa3Passphrase(passphrase: String): WifiNetworkSuggestion.Builder
Set the ASCII WPA3 passphrase for this network. Needed for authenticating to WPA3-SAE networks.
Parameters | |
---|---|
passphrase |
String: passphrase of the network. This value cannot be null . |
Return | |
---|---|
WifiNetworkSuggestion.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the passphrase is not ASCII encodable. |