WifiInfo.Builder


public static final class WifiInfo.Builder
extends Object

java.lang.Object
   ↳ android.net.wifi.WifiInfo.Builder


Builder for WifiInfo

Summary

Public constructors

Builder()

Public methods

WifiInfo build()

Build a WifiInfo object.

WifiInfo.Builder setBssid(String bssid)

Set the BSSID.

WifiInfo.Builder setCurrentSecurityType(int securityType)

Set the current security type

WifiInfo.Builder setNetworkId(int networkId)

Set the network ID.

WifiInfo.Builder setRssi(int rssi)

Set the RSSI, in dBm.

WifiInfo.Builder setSsid(byte[] ssid)

Set the SSID, in the form of a raw byte array.

WifiInfo.Builder setSubscriptionId(int subId)

Set the subscription ID.

Inherited methods

Public constructors

Builder

Added in API level 30
public Builder ()

Public methods

build

Added in API level 30
public WifiInfo build ()

Build a WifiInfo object.

Returns
WifiInfo This value cannot be null.

setBssid

Added in API level 30
public WifiInfo.Builder setBssid (String bssid)

Set the BSSID.

Parameters
bssid String: This value cannot be null.

Returns
WifiInfo.Builder This value cannot be null.

setCurrentSecurityType

Added in API level 31
public WifiInfo.Builder setCurrentSecurityType (int securityType)

Set the current security type

Parameters
securityType int: Value is WifiConfiguration.SECURITY_TYPE_OPEN, WifiConfiguration.SECURITY_TYPE_WEP, WifiConfiguration.SECURITY_TYPE_PSK, WifiConfiguration.SECURITY_TYPE_EAP, WifiConfiguration.SECURITY_TYPE_SAE, WifiConfiguration.SECURITY_TYPE_EAP_SUITE_B, WifiConfiguration.SECURITY_TYPE_OWE, WifiConfiguration.SECURITY_TYPE_WAPI_PSK, WifiConfiguration.SECURITY_TYPE_WAPI_CERT, WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE, WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT, android.net.wifi.WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2, android.net.wifi.WifiConfiguration.SECURITY_TYPE_PASSPOINT_R3, or WifiConfiguration.SECURITY_TYPE_DPP

Returns
WifiInfo.Builder This value cannot be null.

setNetworkId

Added in API level 30
public WifiInfo.Builder setNetworkId (int networkId)

Set the network ID.

Parameters
networkId int

Returns
WifiInfo.Builder This value cannot be null.

setRssi

Added in API level 30
public WifiInfo.Builder setRssi (int rssi)

Set the RSSI, in dBm.

Parameters
rssi int

Returns
WifiInfo.Builder This value cannot be null.

See also:

setSsid

Added in API level 30
public WifiInfo.Builder setSsid (byte[] ssid)

Set the SSID, in the form of a raw byte array.

Parameters
ssid byte: This value cannot be null.

Returns
WifiInfo.Builder This value cannot be null.

See also:

setSubscriptionId

Added in API level 35
public WifiInfo.Builder setSubscriptionId (int subId)

Set the subscription ID.

Parameters
subId int

Returns
WifiInfo.Builder This value cannot be null.