SessionToken
class SessionToken : VersionedParcelable
kotlin.Any | |
↳ | androidx.media2.session.SessionToken |
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 MediaController
to communicate with the session.
It can be also obtained by MediaSessionManager
.
Summary
Constants | |
---|---|
static Int |
Type for |
static Int |
Type for |
static Int |
Type for |
Public constructors | |
---|---|
<init>(@NonNull context: Context, @NonNull serviceComponent: ComponentName) Constructor for the token. |
Public methods | |
---|---|
Boolean | |
Bundle | |
String | |
String? | |
Int |
getType() |
Int |
getUid() |
Int |
hashCode() |
String |
toString() |
Constants
Public constructors
<init>
SessionToken(
@NonNull context: Context,
@NonNull 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 methods
getServiceName
@Nullable fun getServiceName(): String?
Return | |
---|---|
String? |
service name of the session. Can be null for TYPE_SESSION . |
hashCode
fun hashCode(): Int
toString
fun toString(): String