Added in API level 30

Builder


class Builder
kotlin.Any
   ↳ android.net.TelephonyNetworkSpecifier.Builder

Builder to create TelephonyNetworkSpecifier object.

Summary

Public constructors

Public methods
TelephonyNetworkSpecifier

Create a NetworkSpecifier for the cellular network request.

TelephonyNetworkSpecifier.Builder

Set the subscription id.

Public constructors

Builder

Added in API level 30
Builder()

Public methods

build

Added in API level 30
fun build(): TelephonyNetworkSpecifier

Create a NetworkSpecifier for the cellular network request.

Return
TelephonyNetworkSpecifier TelephonyNetworkSpecifier object. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException when subscription Id is not provided through setSubscriptionId(int).

setSubscriptionId

Added in API level 30
fun setSubscriptionId(subId: Int): TelephonyNetworkSpecifier.Builder

Set the subscription id.

Parameters
subId Int: The subscription Id.
Return
TelephonyNetworkSpecifier.Builder Instance of Builder to enable the chaining of the builder method. This value cannot be null.