SessionToken
public
final
class
SessionToken
extends Object
implements
VersionedParcelable
| java.lang.Object | |
| ↳ | androidx.media2.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 | |
|---|---|
int |
TYPE_LIBRARY_SERVICE
Type for |
int |
TYPE_SESSION
Type for |
int |
TYPE_SESSION_SERVICE
Type for |
Public constructors | |
|---|---|
SessionToken(Context context, ComponentName serviceComponent)
Constructor for the token. |
|
Public methods | |
|---|---|
boolean
|
equals(Object obj)
|
String
|
getPackageName()
|
String
|
getServiceName()
|
int
|
getType()
|
int
|
getUid()
|
int
|
hashCode()
|
String
|
toString()
|
Inherited methods | |
|---|---|
Constants
TYPE_LIBRARY_SERVICE
public static final int TYPE_LIBRARY_SERVICE
Type for MediaLibraryService.
Constant Value: 2 (0x00000002)
TYPE_SESSION
public static final int TYPE_SESSION
Type for MediaSession.
Constant Value: 0 (0x00000000)
TYPE_SESSION_SERVICE
public static final int TYPE_SESSION_SERVICE
Type for MediaSessionService.
Constant Value: 1 (0x00000001)
Public constructors
SessionToken
public SessionToken (Context context, ComponentName serviceComponent)
Constructor for the token. You can create token of MediaSessionService,
MediaLibraryService nor MediaBrowserServiceCompat for
MediaController or MediaBrowser.
| Parameters | |
|---|---|
context |
Context: The context. |
serviceComponent |
ComponentName: The component name of the media browser service.
|
Public methods
equals
public boolean equals (Object obj)
| Parameters | |
|---|---|
obj |
Object |
| Returns | |
|---|---|
boolean |
|
getPackageName
public String getPackageName ()
| Returns | |
|---|---|
String |
package name |
getServiceName
public String getServiceName ()
| Returns | |
|---|---|
String |
service name. Can be null for TYPE_SESSION.
|
getType
public int getType ()
| Returns | |
|---|---|
int |
type of the token |
getUid
public int getUid ()
| Returns | |
|---|---|
int |
uid of the session |
hashCode
public int hashCode ()
| Returns | |
|---|---|
int |
|
toString
public String toString ()
| Returns | |
|---|---|
String |
|
Interfaces
Classes
- CallbackMediaItem
- CallbackMediaItem.Builder
- DataSourceCallback
- FileMediaItem
- FileMediaItem.Builder
- HeartRating
- MediaBrowser
- MediaBrowser.BrowserCallback
- MediaBrowser.BrowserResult
- MediaController
- MediaController.ControllerCallback
- MediaController.ControllerResult
- MediaController.PlaybackInfo
- MediaItem
- MediaItem.Builder
- MediaLibraryService
- MediaLibraryService.LibraryParams
- MediaLibraryService.LibraryParams.Builder
- MediaLibraryService.LibraryResult
- MediaLibraryService.MediaLibrarySession
- MediaLibraryService.MediaLibrarySession.Builder
- MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback
- MediaMetadata
- MediaMetadata.Builder
- MediaPlayer
- MediaPlayer.PlayerCallback
- MediaPlayer.TrackInfo
- MediaSession
- MediaSession.Builder
- MediaSession.CommandButton
- MediaSession.CommandButton.Builder
- MediaSession.ControllerInfo
- MediaSession.SessionCallback
- MediaSession.SessionResult
- MediaSessionManager
- MediaSessionService
- MediaSessionService.MediaNotification
- MediaTimestamp
- PercentageRating
- PlaybackParams
- PlaybackParams.Builder
- SessionCommand
- SessionCommandGroup
- SessionCommandGroup.Builder
- SessionPlayer
- SessionPlayer.PlayerCallback
- SessionPlayer.PlayerResult
- SessionToken
- StarRating
- SubtitleData
- ThumbRating
- TimedMetaData
- UriMediaItem
- UriMediaItem.Builder
- VideoSize