wolfskin/app
Ali Alaei 46bf78aac4
Allow play/pause from untrusted media controllers (#2145)
## Description
- From media3 1.11, controllers that aren't trusted get read-only player
commands by default.
- Google Home sends its commands through
com.google.android.apps.mediashell (Google's Cast service on the TV),
which isn't trusted, so play/pause from it was dropped.
- Logcat showed: MediaSessionLegacyStub: Calling play() omitted due to
COMMAND_PLAY_PAUSE not being available
- The change: a MediaSession.Callback (TrustAllControllersCallback in
PlayerFactory.kt) that gives every controller all player commands again.
It uses onConnectAsync and AcceptedResultBuilder(session, controller),
so untrusted controllers keep the restricted session commands.
- It's applied to the video session (createMediaSession) and the music
session (MusicService).
- It probably started with the media3 1.11 bump in #1814.

### Related issues
<!-- If this is a new feature or a change, there must be a discussion in
an issue first, reference the issue here -->
<!-- If fixing a bug, reference the bug issue here, or describe the bug,
including steps to reproduce -->
- Fixes #2087 

### Testing
- JMGO N1S 4K, Google TV, Android 14, ExoPlayer.
- Before the fix: play/pause from Google Home did nothing, and logcat
showed the "omitted" warning.
- After the fix: pause and play from Google Home work. Logcat shows each
command reaching handleSetPlayWhenReady, and the warning is gone.
- The TV remote still works.
- I didn't test music playback; leave that out or test it first.

## Screenshots
- None; no UI changes.

## AI or LLM usage
- Claude Code read the logcat output, found the media3 1.11
untrusted-controller change, and wrote TrustAllControllersCallback plus
the two setCallback(...) calls.
2026-10-31 15:24:07 -04:00
..
config Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
schemas/com.github.damontecres.wholphin.data.AppDatabase Add support for server plugin (#1384) 2026-10-19 14:41:08 -04:00
src Allow play/pause from untrusted media controllers (#2145) 2026-10-31 15:24:07 -04:00
.gitignore Set update URL (#8) 2025-10-15 17:17:16 -04:00
build.gradle.kts Convert Dolby Vision profile 7 to 8.1 on devices without a profile 7 decoder (#2017) 2026-10-28 15:16:42 -04:00
proguard-rules.pro Convert Dolby Vision profile 7 to 8.1 on devices without a profile 7 decoder (#2017) 2026-10-28 15:16:42 -04:00