SessionToken

Added in 1.0.0
Deprecated in 1.3.0

class SessionToken : VersionedParcelable


Represents an ongoing MediaSession or a MediaSessionService. If it's representing a session service, it may not be ongoing.

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

It can be also obtained by MediaSessionManager.

Summary

Constants

const Int

Type for MediaLibraryService.

const Int

Type for MediaSession.

const Int

Type for MediaSessionService.

Public constructors

SessionToken(context: Context, serviceComponent: ComponentName)

Constructor for the token.

Constants

TYPE_LIBRARY_SERVICE

Added in 1.0.0
Deprecated in 1.3.0
const val TYPE_LIBRARY_SERVICE = 2: Int

Type for MediaLibraryService.

TYPE_SESSION

Added in 1.0.0
Deprecated in 1.3.0
const val TYPE_SESSION = 0: Int

Type for MediaSession.

TYPE_SESSION_SERVICE

Added in 1.0.0
Deprecated in 1.3.0
const val TYPE_SESSION_SERVICE = 1: Int

Type for MediaSessionService.

Public constructors

SessionToken

Added in 1.0.0
Deprecated in 1.3.0
SessionToken(context: Context, serviceComponent: ComponentName)

Constructor for the token. You can create token of MediaSessionService, MediaLibraryService or MediaBrowserServiceCompat for MediaController or MediaBrowser.

Parameters
context: Context

The context.

serviceComponent: ComponentName

The component name of the service.

Public functions

equals

fun equals(obj: Any!): Boolean

getExtras

Added in 1.0.0
Deprecated in 1.3.0
fun getExtras(): Bundle
Returns
Bundle

extras of the token

See also
setExtras

getPackageName

Added in 1.0.0
Deprecated in 1.3.0
fun getPackageName(): String
Returns
String

package name of the session

getServiceName

Added in 1.0.0
Deprecated in 1.3.0
fun getServiceName(): String?
Returns
String?

service name of the session. Can be null for TYPE_SESSION.

getType

Added in 1.0.0
Deprecated in 1.3.0
fun getType(): Int
Returns
Int

type of the token

getUid

Added in 1.0.0
Deprecated in 1.3.0
fun getUid(): Int
Returns
Int

uid of the session

hashCode

fun hashCode(): Int

toString

fun toString(): String!