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 74f2e1ed..0dd7b2cb 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 @@ -138,19 +138,21 @@ class MediaSessionCallback(var playerNotificationService:PlayerNotificationServi Log.d(tag, "handleCallMediaButton keyEvent = $keyEvent | action ${keyEvent?.action}") - if (keyEvent?.action == KeyEvent.ACTION_DOWN) { - Log.d(tag, "handleCallMediaButton: key action_down for ${keyEvent.keyCode}") - when (keyEvent.keyCode) { - KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> { - Log.d(tag, "handleCallMediaButton: Media Play/Pause") - if (playerNotificationService.mPlayer.isPlaying) { - playerNotificationService.pause() - } else { - playerNotificationService.play() - } - } - } - } + // TODO: Widget was only sending this event on key down + // but this cannot be defined in both key down and key up +// if (keyEvent?.action == KeyEvent.ACTION_DOWN) { +// Log.d(tag, "handleCallMediaButton: key action_down for ${keyEvent.keyCode}") +// when (keyEvent.keyCode) { +// KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> { +// Log.d(tag, "handleCallMediaButton: Media Play/Pause") +// if (playerNotificationService.mPlayer.isPlaying) { +// playerNotificationService.pause() +// } else { +// playerNotificationService.play() +// } +// } +// } +// } if (keyEvent?.action == KeyEvent.ACTION_UP) { Log.d(tag, "handleCallMediaButton: key action_up for ${keyEvent.keyCode}")