Builder


class Builder
kotlin.Any
   ↳ android.net.TetheringManager.TetheringRequest.Builder

Builder used to create TetheringRequest.

Summary

Public constructors
Builder(type: Int)

Default constructor of Builder.

Public methods
open TetheringManager.TetheringRequest

Build TetheringRequest with the currently set configuration.

open TetheringManager.TetheringRequest.Builder

Set the desired SoftApConfiguration for TETHERING_WIFI.

Public constructors

Builder

Builder(type: Int)

Default constructor of Builder.

Parameters
type Int: Value is android.net.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

open fun build(): TetheringManager.TetheringRequest

Build TetheringRequest with the currently set configuration.

Return
TetheringManager.TetheringRequest This value cannot be null.

setSoftApConfiguration

open fun setSoftApConfiguration(softApConfig: SoftApConfiguration?): TetheringManager.TetheringRequest.Builder

Set the desired SoftApConfiguration for TETHERING_WIFI. If this is null or not set, then the persistent tethering SoftApConfiguration from android.net.wifi.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 android.Manifest.permission#TETHER_PRIVILEGED
Parameters
softApConfig SoftApConfiguration?: SoftApConfiguration to use. This value may be null.
Exceptions
java.lang.IllegalArgumentException if the tethering type isn't TETHERING_WIFI.