Added in API level 31
Builder
class Builder
kotlin.Any | |
↳ | android.media.metrics.PlaybackStateEvent.Builder |
A builder for PlaybackStateEvent
Summary
Public constructors | |
---|---|
Builder() Creates a new Builder. |
Public methods | |
---|---|
PlaybackStateEvent |
build() Builds the instance. |
PlaybackStateEvent.Builder |
setMetricsBundle(metricsBundle: Bundle) Sets metrics-related information that is not supported by dedicated methods. |
PlaybackStateEvent.Builder |
Sets playback state. |
PlaybackStateEvent.Builder |
setTimeSinceCreatedMillis(value: Long) Sets timestamp since the creation in milliseconds. |
Public constructors
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 . |
setState
Added in API level 31
fun setState(value: Int): PlaybackStateEvent.Builder
Sets playback state.
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 . |
See Also