Pause instead of close playback on KEYCODE_MEDIA_STOP (#1913)

Car head units send KEYCODE_MEDIA_STOP when powering off, which was
calling closePlayback() and destroying the session entirely. This removed
the media notification from the shade and required manually reopening the
app to resume listening.

Change to pause() so the session and notification stay alive, matching
the behavior of YouTube, Plex, and Jellyfin. When the car powers back on
and sends KEYCODE_MEDIA_PLAY, playback resumes in the same session.
This commit is contained in:
epipenRX
2026-09-07 17:41:37 -05:00
committed by GitHub
parent 1a290b4d07
commit a09326b5b2
@@ -234,7 +234,7 @@ class MediaSessionCallback(var playerNotificationService:PlayerNotificationServi
playerNotificationService.jumpBackward()
}
KeyEvent.KEYCODE_MEDIA_STOP -> {
playerNotificationService.closePlayback()
playerNotificationService.pause()
}
else -> {
Log.d(tag, "KeyCode:${keyEvent.keyCode}")