Interface SessionCallbackBuilder.CustomCommandProvider
-
- Enclosing class:
- SessionCallbackBuilder
public static interface SessionCallbackBuilder.CustomCommandProvider
Callbacks for querying what custom commands are supported, and for handling a custom command when a controller sends it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description androidx.media2.session.SessionCommandGroup
getCustomCommands(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo)
Returns aSessionCommandGroup
with custom commands to publish to the controller, ornull
if no custom commands should be published.androidx.media2.session.SessionResult
onCustomCommand(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo, androidx.media2.session.SessionCommand customCommand, Bundle args)
Called when a controller has sent a custom command.
-
-
-
Method Detail
-
onCustomCommand
androidx.media2.session.SessionResult onCustomCommand(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo, androidx.media2.session.SessionCommand customCommand, @Nullable Bundle args)
Called when a controller has sent a custom command.- Parameters:
session
- The media session.controllerInfo
- TheMediaSession.ControllerInfo
for the controller that sent the custom command.customCommand
- ASessionCommand
from the controller.args
- ABundle
with the extra argument.- See Also:
MediaSession.SessionCallback.onCustomCommand(MediaSession, MediaSession.ControllerInfo, SessionCommand, Bundle)
,MediaController.sendCustomCommand(SessionCommand, Bundle)
-
getCustomCommands
@Nullable androidx.media2.session.SessionCommandGroup getCustomCommands(androidx.media2.session.MediaSession session, androidx.media2.session.MediaSession.ControllerInfo controllerInfo)
Returns aSessionCommandGroup
with custom commands to publish to the controller, ornull
if no custom commands should be published.- Parameters:
session
- The media session.controllerInfo
- TheMediaSession.ControllerInfo
for the controller that is requesting custom commands.- Returns:
- The custom commands to publish, or
null
if no custom commands should be published.
-
-