NetworkEvent.Builder

public static final class NetworkEvent.Builder
extends Object

java.lang.Object
   ↳ android.media.metrics.NetworkEvent.Builder


A builder for NetworkEvent

Summary

Public constructors

Builder()

Creates a new Builder.

Public methods

NetworkEvent build()

Builds the instance.

NetworkEvent.Builder setMetricsBundle(Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

NetworkEvent.Builder setNetworkType(int value)

Sets network type.

NetworkEvent.Builder setTimeSinceCreatedMillis(long value)

Sets timestamp since the creation in milliseconds.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder ()

Creates a new Builder.

Public methods

build

Added in API level 31
public NetworkEvent build ()

Builds the instance.

Returns
NetworkEvent This value cannot be null.

setMetricsBundle

Added in API level 31
public NetworkEvent.Builder setMetricsBundle (Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

It is intended to be used for backwards compatibility by the metrics infrastructure.

Parameters
metricsBundle Bundle: This value cannot be null.

Returns
NetworkEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

Added in API level 31
public NetworkEvent.Builder setTimeSinceCreatedMillis (long value)

Sets timestamp since the creation in milliseconds.

Parameters
value long: the timestamp since the creation in milliseconds. -1 indicates the value is unknown. Value is -1 or greater

Returns
NetworkEvent.Builder This value cannot be null.