MediaSessionStatus.Builder


public final class MediaSessionStatus.Builder


Builder for media session status objects.

Summary

Public constructors

Builder(int sessionState)

Creates a media session status builder using the current time as the reference timestamp.

Creates a media session status builder whose initial contents are copied from an existing status.

Public methods

@NonNull MediaSessionStatus

Builds the media session status object.

@NonNull MediaSessionStatus.Builder

Sets a bundle of extras for this status object.

@NonNull MediaSessionStatus.Builder
setQueuePaused(boolean queuePaused)

Sets whether the queue is paused.

@NonNull MediaSessionStatus.Builder
setSessionState(int sessionState)

Sets the session state.

@NonNull MediaSessionStatus.Builder
setTimestamp(long elapsedRealtimeTimestamp)

Sets the timestamp associated with the status information in milliseconds since boot in the elapsedRealtime time base.

Public constructors

Builder

Added in 1.1.0
public Builder(int sessionState)

Creates a media session status builder using the current time as the reference timestamp.

Parameters
int sessionState

The session state.

Builder

Added in 1.1.0
public Builder(@NonNull MediaSessionStatus status)

Creates a media session status builder whose initial contents are copied from an existing status.

Public methods

build

Added in 1.1.0
public @NonNull MediaSessionStatus build()

Builds the media session status object.

setExtras

Added in 1.1.0
public @NonNull MediaSessionStatus.Builder setExtras(@Nullable Bundle extras)

Sets a bundle of extras for this status object. The extras will be ignored by the media router but they may be used by applications.

setQueuePaused

Added in 1.1.0
public @NonNull MediaSessionStatus.Builder setQueuePaused(boolean queuePaused)

Sets whether the queue is paused.

setSessionState

Added in 1.1.0
public @NonNull MediaSessionStatus.Builder setSessionState(int sessionState)

Sets the session state.

setTimestamp

Added in 1.1.0
public @NonNull MediaSessionStatus.Builder setTimestamp(long elapsedRealtimeTimestamp)

Sets the timestamp associated with the status information in milliseconds since boot in the elapsedRealtime time base.