added in version 22.1.0
belongs to Maven artifact


public final class MediaSessionStatus
extends Object


Describes the playback status of a media session.

This class is part of the remote playback protocol described by the MediaControlIntent class.

When a media session is created, it is initially in the active state. When the media session ends normally, it transitions to the ended state. If the media session is invalidated due to another session forcibly taking control of the route, then it transitions to the invalidated state. Refer to the documentation of each state for an explanation of its meaning.

To monitor session status, the application should supply a PendingIntent to use as the session status update receiver for a given session start request.

This object is immutable once created using a MediaSessionStatus.Builder instance.


Nested classes

class MediaSessionStatus.Builder

Builder for media session status objects



Session state: Active.


Session state: Ended.


Session state: Invalidated.

Public methods

Bundle asBundle()

Converts this object to a bundle for serialization.

static MediaSessionStatus fromBundle(Bundle bundle)

Creates an instance from a bundle.

Bundle getExtras()

Gets a bundle of extras for this status object.

int getSessionState()

Gets the session state.

long getTimestamp()

Gets the timestamp associated with the status information in milliseconds since boot in the elapsedRealtime() time base.

boolean isQueuePaused()

Returns true if the session's queue is paused.

String toString()

Inherited methods

From class java.lang.Object