-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sending custom commands with a media browser
When sending a custom command with `browser.sendCustomCommand` when connected to a legacy browser service, the custom command was delivered to `MediaSessionCompat.Callback.onCustomAction` instead of the service method `onCustomAction`. The difference is that the service version can return an async response with a bundle, while the session callback version doesn't have a return value. Hence, the service method was never called and it wasn't possible to send a reponse or signal an error back to the browser. The resulting `ListanableFuture` simply always immediately resolved to a success. This change overrides `ListenableFuture<SessionResult> sendCustomCommand(SessionCommand command, Bundle args)` in `MediaBrowserImplLegacy` to use the `MediaBrowserCompat` method to send instead of the `MediaControlleCompat` method that was used by the subclass `MediaControllerImplLegacy`. This involves the service callback instead of the session callback and enables `MediaBrowser` to get the actual return value from the legacy service. Issue: #1474 #cherrypick PiperOrigin-RevId: 676519314
- Loading branch information
1 parent
3c5e764
commit 6bda0da
Showing
6 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters