TetheringManager.TetheringRequest.Builder


public static class TetheringManager.TetheringRequest.Builder
extends Object

java.lang.Object
   ↳ android.net.TetheringManager.TetheringRequest.Builder


Builder used to create TetheringRequest.

Summary

Public constructors

Builder(int type)

Default constructor of Builder.

Public methods

TetheringManager.TetheringRequest build()

Build TetheringRequest with the currently set configuration.

TetheringManager.TetheringRequest.Builder setSoftApConfiguration(SoftApConfiguration softApConfig)

Set the desired SoftApConfiguration for TetheringManager.TETHERING_WIFI.

Inherited methods

Public constructors

Builder

public Builder (int type)

Default constructor of Builder.

Parameters
type int: Value is TetheringManager.TETHERING_WIFI, android.net.TetheringManager.TETHERING_USB, android.net.TetheringManager.TETHERING_BLUETOOTH, android.net.TetheringManager.TETHERING_WIFI_P2P, android.net.TetheringManager.TETHERING_NCM, android.net.TetheringManager.TETHERING_ETHERNET, or android.net.TetheringManager.TETHERING_VIRTUAL

Public methods

build

public TetheringManager.TetheringRequest build ()

Build TetheringRequest with the currently set configuration.

Returns
TetheringManager.TetheringRequest This value cannot be null.

setSoftApConfiguration

public TetheringManager.TetheringRequest.Builder setSoftApConfiguration (SoftApConfiguration softApConfig)

Set the desired SoftApConfiguration for TetheringManager.TETHERING_WIFI. If this is null or not set, then the persistent tethering SoftApConfiguration from ERROR(WifiManager.getSoftApConfiguration()/android.net.wifi.WifiManager#getSoftApConfiguration() WifiManager.getSoftApConfiguration()) will be used.

If TETHERING_WIFI is already enabled and a new request is made with a different SoftApConfiguration, the request will be accepted if the device can support an additional tethering Wi-Fi AP interface. Otherwise, the request will be rejected.

Non-system callers using TETHERING_WIFI must specify a SoftApConfiguration.
Requires ERROR(/android.Manifest.permission#TETHER_PRIVILEGED)

Parameters
softApConfig SoftApConfiguration: SoftApConfiguration to use. This value may be null.

Returns
TetheringManager.TetheringRequest.Builder

Throws
IllegalArgumentException if the tethering type isn't TETHERING_WIFI.