java.lang.Object | |
↳ | android.support.v7.media.MediaSessionStatus |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MediaSessionStatus.Builder |
Builder for media session status objects .
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SESSION_STATE_ACTIVE | Session state: Active. | |||||||||
int | SESSION_STATE_ENDED | Session state: Ended. | |||||||||
int | SESSION_STATE_INVALIDATED | Session state: Invalidated. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Converts this object to a bundle for serialization.
| |||||||||||
Creates an instance from a bundle.
| |||||||||||
Gets a bundle of extras for this status object.
| |||||||||||
Gets the session state.
| |||||||||||
Gets the timestamp associated with the status information in
milliseconds since boot in the
elapsedRealtime() time base.
| |||||||||||
Returns true if the session's queue is paused.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Session state: Active.
Indicates that the media session is active and in control of the route.
Session state: Ended.
Indicates that the media session was ended normally using the
end session
action.
A terminated media session cannot be used anymore. To play more media, the application must start a new session.
Session state: Invalidated.
Indicates that the media session was invalidated involuntarily due to another session taking control of the route.
An invalidated media session cannot be used anymore. To play more media, the application must start a new session.
Converts this object to a bundle for serialization.
Creates an instance from a bundle.
bundle | The bundle, or null if none. |
---|
Gets a bundle of extras for this status object. The extras will be ignored by the media router but they may be used by applications.
Gets the session state.
SESSION_STATE_ACTIVE
,
SESSION_STATE_ENDED
, or SESSION_STATE_INVALIDATED
.
Gets the timestamp associated with the status information in
milliseconds since boot in the elapsedRealtime()
time base.
elapsedRealtime()
time base.
Returns true if the session's queue is paused.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.