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() .setDataNetworkName("example_dnn") .setConnectionCapability(TrafficDescriptor.CONNECTION_CAPABILITY_***) .build(); </code>
Summary
| Public constructors | |
|---|---|
Builder()Default constructor for Builder. |
|
| Public methods | |
|---|---|
| TrafficDescriptor |
build()Build the |
| TrafficDescriptor.Builder |
setConnectionCapability(connectionCapability: Int)Set the connection capability of the traffic. |
| TrafficDescriptor.Builder |
setDataNetworkName(dnn: String)Set the Data Network Name(DNN). |
| TrafficDescriptor.Builder |
setOsAppId(osAppId: ByteArray)Set the OS App ID (including OS Id as defined in the specs). |
Public constructors
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, OS App ID are null and Connection Capability is UNKNOWN. |
setConnectionCapability
Added in API level 31
fun setConnectionCapability(connectionCapability: Int): TrafficDescriptor.Builder
Set the connection capability of the traffic.
| Return | |
|---|---|
TrafficDescriptor.Builder |
The same instance of the builder. This value cannot be 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. |