From 8584299c76ca1ea19695dda404b4bc230fa23fc7 Mon Sep 17 00:00:00 2001 From: Adrian Ulrich Date: Thu, 15 Mar 2018 20:49:25 +0100 Subject: [PATCH] always announce PLAY|PAUSE to headset. Doing this only when it makes 'sense' seems to cause issues with some BT devices. --- .../blinkenlights/android/vanilla/RemoteControlImplLp.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/ch/blinkenlights/android/vanilla/RemoteControlImplLp.java b/app/src/main/java/ch/blinkenlights/android/vanilla/RemoteControlImplLp.java index 48f10231..fbc1eef2 100644 --- a/app/src/main/java/ch/blinkenlights/android/vanilla/RemoteControlImplLp.java +++ b/app/src/main/java/ch/blinkenlights/android/vanilla/RemoteControlImplLp.java @@ -148,12 +148,11 @@ public class RemoteControlImplLp implements RemoteControl.Client { } int playbackState = (isPlaying ? PlaybackState.STATE_PLAYING : PlaybackState.STATE_PAUSED); - long actions = (PlaybackState.ACTION_PLAY_PAUSE | PlaybackState.ACTION_SKIP_TO_NEXT | PlaybackState.ACTION_SKIP_TO_PREVIOUS); - actions |= (isPlaying ? PlaybackState.ACTION_PAUSE : PlaybackState.ACTION_PLAY); session.setPlaybackState(new PlaybackState.Builder() .setState(playbackState, PlaybackState.PLAYBACK_POSITION_UNKNOWN , 1.0f) - .setActions(actions) + .setActions(PlaybackState.ACTION_PLAY | PlaybackState.ACTION_PAUSE | PlaybackState.ACTION_PLAY_PAUSE | + PlaybackState.ACTION_SKIP_TO_NEXT | PlaybackState.ACTION_SKIP_TO_PREVIOUS) .build()); mMediaSession.setActive(true); }