SessionCommand
class SessionCommand : VersionedParcelable
kotlin.Any | |
↳ | androidx.media2.session.SessionCommand |
Defines a command that a MediaController
can send to a MediaSession
.
If getCommandCode()
isn't COMMAND_CODE_CUSTOM
), it's predefined command. If getCommandCode()
is COMMAND_CODE_CUSTOM
), it's custom command and getCustomAction()
shouldn't be null
.
Summary
Public constructors | |
---|---|
Constructor for creating a predefined command. |
|
Constructor for creating a custom command. |
Public methods | |
---|---|
Boolean | |
Int |
Gets the command code of a predefined command. |
String? |
Gets the action of a custom command. |
Bundle? |
Gets the extra bundle of a custom command. |
Int |
hashCode() |
Constants
COMMAND_CODE_CUSTOM
static val COMMAND_CODE_CUSTOM: Int
Command code for the custom command which can be defined by string action in the SessionCommand
.
Value: 0
COMMAND_CODE_LIBRARY_GET_CHILDREN
static val COMMAND_CODE_LIBRARY_GET_CHILDREN: Int
Command code for MediaBrowser#getChildren(String, int, int, LibraryParams)
.
Code version is COMMAND_VERSION_1
.
Value: 50003
COMMAND_CODE_LIBRARY_GET_ITEM
static val COMMAND_CODE_LIBRARY_GET_ITEM: Int
Command code for MediaBrowser#getItem(String)
.
Code version is COMMAND_VERSION_1
.
Value: 50004
COMMAND_CODE_LIBRARY_GET_LIBRARY_ROOT
static val COMMAND_CODE_LIBRARY_GET_LIBRARY_ROOT: Int
Command code for MediaBrowser#getLibraryRoot(LibraryParams)
.
Code version is COMMAND_VERSION_1
.
Value: 50000
COMMAND_CODE_LIBRARY_GET_SEARCH_RESULT
static val COMMAND_CODE_LIBRARY_GET_SEARCH_RESULT: Int
Command code for MediaBrowser#getSearchResult(String, int, int, LibraryParams)
.
Code version is COMMAND_VERSION_1
.
Value: 50006
COMMAND_CODE_LIBRARY_SEARCH
static val COMMAND_CODE_LIBRARY_SEARCH: Int
Command code for MediaBrowser#search(String, LibraryParams)
.
Code version is COMMAND_VERSION_1
.
Value: 50005
COMMAND_CODE_LIBRARY_SUBSCRIBE
static val COMMAND_CODE_LIBRARY_SUBSCRIBE: Int
Command code for MediaBrowser#subscribe(String, LibraryParams)
.
Code version is COMMAND_VERSION_1
.
Value: 50001
COMMAND_CODE_LIBRARY_UNSUBSCRIBE
static val COMMAND_CODE_LIBRARY_UNSUBSCRIBE: Int
Command code for MediaBrowser#unsubscribe(String)
.
Code version is COMMAND_VERSION_1
.
Value: 50002
COMMAND_CODE_PLAYER_ADD_PLAYLIST_ITEM
static val COMMAND_CODE_PLAYER_ADD_PLAYLIST_ITEM: Int
Command code for MediaController#addPlaylistItem(int, String)
.
Command would be sent directly to the player if the session doesn't reject the request through the SessionCallback#onCommandRequest(MediaSession, ControllerInfo, SessionCommand)
.
Code version is COMMAND_VERSION_1
.
Value: 10013
COMMAND_CODE_PLAYER_DESELECT_TRACK
static val COMMAND_CODE_PLAYER_DESELECT_TRACK: Int
Command code for MediaController#deselectTrack(SessionPlayer.TrackInfo).
Command would be sent directly to the player if the session doesn't reject the request through the SessionCallback#onCommandRequest(MediaSession, ControllerInfo, SessionCommand)
.
Code version is COMMAND_VERSION_1
.
Value: 11002
COMMAND_CODE_PLAYER_GET_CURRENT_MEDIA_ITEM
static val COMMAND_CODE_PLAYER_GET_CURRENT_MEDIA_ITEM: Int
Command code for MediaController#getCurrentMediaItem()
. This will expose metadata information to the controller.
Code version is COMMAND_VERSION_1
.
Value: 10016
COMMAND_CODE_PLAYER_GET_PLAYLIST
static val COMMAND_CODE_PLAYER_GET_PLAYLIST: Int
Command code for MediaController#getPlaylist