Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.telephony.data.TrafficDescriptor.Builder

Provides a convenient way to set the fields of a TrafficDescriptor when creating a new instance.

The example below shows how you might create a new TrafficDescriptor:

<code>
 
  TrafficDescriptor response = new TrafficDescriptor.Builder()
      .setDnn("")
      .build();
  </code>

Summary

Public constructors

Default constructor for Builder.

Public methods
TrafficDescriptor

Build the TrafficDescriptor.

TrafficDescriptor.Builder

Set the Data Network Name(DNN).

TrafficDescriptor.Builder

Set the OS App ID (including OS Id as defined in the specs).

Public constructors

Builder

Added in API level 31
Builder()

Default constructor for Builder.

Public methods

build

Added in API level 31
fun build(): TrafficDescriptor

Build the TrafficDescriptor.

Return
TrafficDescriptor the TrafficDescriptor object. This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if DNN and OS App ID are null.

setDataNetworkName

Added in API level 31
fun setDataNetworkName(dnn: String): TrafficDescriptor.Builder

Set the Data Network Name(DNN).

Parameters
dnn String: This value cannot be null.
Return
TrafficDescriptor.Builder The same instance of the builder. This value cannot be null.

setOsAppId

Added in API level 31
fun setOsAppId(osAppId: ByteArray): TrafficDescriptor.Builder

Set the OS App ID (including OS Id as defined in the specs).

Parameters
osAppId ByteArray: This value cannot be null.
Return
TrafficDescriptor.Builder The same instance of the builder. This value cannot be null.