Playback: Avoid double call on play/pause

(cherry picked from commit 6553cc4720)
This commit is contained in:
Geoffrey Métais
2018-03-07 15:14:27 +01:00
parent ea6b9f604a
commit 86d31810d7

View File

@@ -450,9 +450,8 @@ public class PlaybackService extends MediaBrowserServiceCompat{
* Remote / headset control events
*/
if (action.equalsIgnoreCase(Constants.ACTION_REMOTE_PLAYPAUSE)) {
if (!playlistManager.hasCurrentMedia())
loadLastAudioPlaylist();
if (isPlaying()) pause();
if (!playlistManager.hasCurrentMedia()) loadLastAudioPlaylist();
else if (isPlaying()) pause();
else play();
} else if (action.equalsIgnoreCase(Constants.ACTION_REMOTE_PLAY)) {
if (!isPlaying() && playlistManager.hasCurrentMedia())