SessionCommand
class SessionCommand
A command that a MediaController can send to a MediaSession.
If commandCode isn't COMMAND_CODE_CUSTOM, it's a predefined command. If commandCode is COMMAND_CODE_CUSTOM, it's a custom command and customAction must not be null.
Summary
Nested types |
|---|
@DocumentedCommand codes of session commands. |
Constants |
|
|---|---|
const Int |
Command code for the custom command which can be defined by string action in the |
const Int |
Command code for |
const Int |
COMMAND_CODE_LIBRARY_GET_ITEM = 50004Command code for |
const Int |
Command code for |
const Int |
Command code for |
const Int |
COMMAND_CODE_LIBRARY_SEARCH = 50005Command code for |
const Int |
COMMAND_CODE_LIBRARY_SUBSCRIBE = 50001Command code for |
const Int |
COMMAND_CODE_LIBRARY_UNSUBSCRIBE = 50002Command code for |
const Int |
COMMAND_CODE_SESSION_SET_RATING = 40010Command code for |
Public constructors |
|---|
SessionCommand(@SessionCommand.CommandCode commandCode: Int)Creates a predefined command. |
SessionCommand(action: String!, extras: Bundle!)Creates a custom command. |
Public functions |
|
|---|---|
Boolean |
Checks the given session command for equality while ignoring extras. |
java-static SessionCommand! |
@UnstableApiRestores a |
Int |
hashCode() |
Bundle! |
Public properties |
|
|---|---|
Int |
The command code of a predefined command. |
String! |
The action of a custom command. |
Bundle! |
The extra bundle of a custom command. |
Constants
COMMAND_CODE_CUSTOM
const val COMMAND_CODE_CUSTOM = 0: Int
Command code for the custom command which can be defined by string action in the SessionCommand.
COMMAND_CODE_LIBRARY_GET_CHILDREN
const val COMMAND_CODE_LIBRARY_GET_CHILDREN = 50003: Int
Command code for getChildren.
COMMAND_CODE_LIBRARY_GET_ITEM
const val COMMAND_CODE_LIBRARY_GET_ITEM = 50004: Int
Command code for getItem.
COMMAND_CODE_LIBRARY_GET_LIBRARY_ROOT
const val COMMAND_CODE_LIBRARY_GET_LIBRARY_ROOT = 50000: Int
Command code for getLibraryRoot.
COMMAND_CODE_LIBRARY_GET_SEARCH_RESULT
const val COMMAND_CODE_LIBRARY_GET_SEARCH_RESULT = 50006: Int
Command code for getSearchResult.
COMMAND_CODE_LIBRARY_SEARCH
const val COMMAND_CODE_LIBRARY_SEARCH = 50005: Int
Command code for search.
COMMAND_CODE_LIBRARY_SUBSCRIBE
const val COMMAND_CODE_LIBRARY_SUBSCRIBE = 50001: Int
Command code for subscribe.
COMMAND_CODE_LIBRARY_UNSUBSCRIBE
const val COMMAND_CODE_LIBRARY_UNSUBSCRIBE = 50002: Int
Command code for unsubscribe.
COMMAND_CODE_SESSION_SET_RATING
const val COMMAND_CODE_SESSION_SET_RATING = 40010: Int
Command code for setRating.
Public constructors
SessionCommand
SessionCommand(@SessionCommand.CommandCode commandCode: Int)
Creates a predefined command.
| Parameters | |
|---|---|
@SessionCommand.CommandCode commandCode: Int |
A command code for a predefined command. |
Public functions
equals
fun equals(obj: Any?): Boolean
Checks the given session command for equality while ignoring extras.
fromBundle
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): SessionCommand!
Restores a SessionCommand from a Bundle.
Public properties
commandCode
@SessionCommand.CommandCode
val commandCode: Int
The command code of a predefined command. It will be COMMAND_CODE_CUSTOM for a custom command.
customAction
val customAction: String!
The action of a custom command. It will be an empty string for a predefined command.
customExtras
val customExtras: Bundle!
The extra bundle of a custom command. It will be EMPTY for a predefined command.