From a09326b5b29f5b75291da19ebdc488bd75262a18 Mon Sep 17 00:00:00 2001 From: epipenRX <167610748+epipenRX@users.noreply.github.com> Date: Mon, 7 Sep 2026 17:41:37 -0500 Subject: [PATCH] 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. --- .../java/com/audiobookshelf/app/player/MediaSessionCallback.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/audiobookshelf/app/player/MediaSessionCallback.kt b/android/app/src/main/java/com/audiobookshelf/app/player/MediaSessionCallback.kt index a7aa7fa8..c87e912e 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/player/MediaSessionCallback.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/player/MediaSessionCallback.kt @@ -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}")