MediaSessionCompat.Token


public final class MediaSessionCompat.Token implements Parcelable


Represents an ongoing session. This may be passed to apps by the session owner to allow them to create a MediaControllerCompat to communicate with the session.

Summary

Public methods

int
boolean
static MediaSessionCompat.Token

Creates a compat Token from a framework android.media.session.MediaSession.Token object.

Object

Gets the underlying framework android.media.session.MediaSession.Token object.

int
void
writeToParcel(Parcel dest, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Constants

CREATOR

Added in 1.1.0
public static final Parcelable.Creator<MediaSessionCompat.TokenCREATOR

Public methods

describeContents

Added in 1.1.0
public int describeContents()

equals

public boolean equals(Object obj)

fromToken

Added in 1.1.0
public static MediaSessionCompat.Token fromToken(Object token)

Creates a compat Token from a framework android.media.session.MediaSession.Token object.

This method is only supported on LOLLIPOP and later.

Parameters
Object token

The framework token object.

Returns
MediaSessionCompat.Token

A compat Token for use with MediaControllerCompat.

getToken

Added in 1.1.0
public Object getToken()

Gets the underlying framework android.media.session.MediaSession.Token object.

This method is only supported on API 21+.

Returns
Object

The underlying android.media.session.MediaSession.Token object, or null if none.

hashCode

public int hashCode()

writeToParcel

Added in 1.1.0
public void writeToParcel(Parcel dest, int flags)