Added in API level 31

Builder

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

A builder for PlaybackStateEvent

Summary

Public constructors

Creates a new Builder.

Public methods
PlaybackStateEvent

Builds the instance.

PlaybackStateEvent.Builder
setMetricsBundle(metricsBundle: Bundle)

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

PlaybackStateEvent.Builder
setState(value: Int)

Sets playback state.

PlaybackStateEvent.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(): PlaybackStateEvent

Builds the instance.

Return
PlaybackStateEvent This value cannot be null.

setMetricsBundle

Added in API level 31
fun setMetricsBundle(metricsBundle: Bundle): PlaybackStateEvent.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
PlaybackStateEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

Added in API level 31
fun setTimeSinceCreatedMillis(value: Long): PlaybackStateEvent.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
PlaybackStateEvent.Builder This value cannot be null.