WifiP2pUsdBasedServiceDiscoveryConfig.Builder


public static final class WifiP2pUsdBasedServiceDiscoveryConfig.Builder
extends Object

java.lang.Object
   ↳ android.net.wifi.p2p.WifiP2pUsdBasedServiceDiscoveryConfig.Builder


Builder for WifiP2pUsdBasedServiceDiscoveryConfig.

Summary

Public constructors

Builder()

Constructs a Builder with default values.

Public methods

WifiP2pUsdBasedServiceDiscoveryConfig build()

Build WifiP2pUsdBasedServiceDiscoveryConfig given the current requests made on the builder.

WifiP2pUsdBasedServiceDiscoveryConfig.Builder setBand(int band)

Specifies the band requested for service discovery.

WifiP2pUsdBasedServiceDiscoveryConfig.Builder setFrequenciesMhz(int[] frequenciesMhz)

Set the frequencies requested for service discovery.

Inherited methods

Public constructors

Builder

public Builder ()

Constructs a Builder with default values.

Public methods

build

public WifiP2pUsdBasedServiceDiscoveryConfig build ()

Build WifiP2pUsdBasedServiceDiscoveryConfig given the current requests made on the builder.

Returns
WifiP2pUsdBasedServiceDiscoveryConfig WifiP2pUsdBasedServiceDiscoveryConfig constructed based on builder method calls. This value cannot be null.

setBand

public WifiP2pUsdBasedServiceDiscoveryConfig.Builder setBand (int band)

Specifies the band requested for service discovery. The band should be one of the following band constants defined in ScanResult#WIFI_BAND_24_GHZ, ScanResult#WIFI_BAND_5_GHZ or ScanResult#WIFI_BAND_6_GHZ

setBand(int) and setFrequenciesMhz(int[]) are mutually exclusive. Setting operating band and frequency both is invalid.

Optional. ScanResult#UNSPECIFIED by default.

Parameters
band int: The requested band.

Returns
WifiP2pUsdBasedServiceDiscoveryConfig.Builder Instance of Builder to enable chaining of the builder method. This value cannot be null.

Throws
IllegalArgumentException - if the band specified is not one among the list of bands mentioned above.

setFrequenciesMhz

public WifiP2pUsdBasedServiceDiscoveryConfig.Builder setFrequenciesMhz (int[] frequenciesMhz)

Set the frequencies requested for service discovery.

setBand(int) and setFrequenciesMhz(int[]) are mutually exclusive. Setting band and frequencies both is invalid.

Optional. 2437 by default.

Parameters
frequenciesMhz int: Frequencies in MHz to scan for services. This value cannot be null.

Returns
WifiP2pUsdBasedServiceDiscoveryConfig.Builder Instance of Builder to enable chaining of the builder method. This value cannot be null.