Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.media.metrics.NetworkEvent.Builder

A builder for NetworkEvent

Summary

Public constructors

Creates a new Builder.

Public methods
NetworkEvent

Builds the instance.

NetworkEvent.Builder
setMetricsBundle(metricsBundle: Bundle)

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

NetworkEvent.Builder

Sets network type.

NetworkEvent.Builder

Sets timestamp since the creation in milliseconds.

Public constructors

Builder

Added in API level 31
Builder()

Creates a new Builder.

Public methods

build

Added in API level 31
fun build(): NetworkEvent

Builds the instance.

Return
NetworkEvent This value cannot be null.

setMetricsBundle

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

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.
Return
NetworkEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

Added in API level 31
fun setTimeSinceCreatedMillis(value: Long): NetworkEvent.Builder

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
Return
NetworkEvent.Builder This value cannot be null.