use isPlaying to determine which notification action to display in compact view

PiperOrigin-RevId: 266782250
This commit is contained in:
bachinger 2019-09-02 16:05:31 +01:00 committed by Toni
parent 494b6f6f3b
commit eedf50fdca

View File

@ -1182,10 +1182,10 @@ public class PlayerNotificationManager {
if (skipPreviousActionIndex != -1) {
actionIndices[actionCounter++] = skipPreviousActionIndex;
}
boolean playWhenReady = player.getPlayWhenReady();
if (pauseActionIndex != -1 && playWhenReady) {
boolean isPlaying = isPlaying(player);
if (pauseActionIndex != -1 && isPlaying) {
actionIndices[actionCounter++] = pauseActionIndex;
} else if (playActionIndex != -1 && !playWhenReady) {
} else if (playActionIndex != -1 && !isPlaying) {
actionIndices[actionCounter++] = playActionIndex;
}
if (skipNextActionIndex != -1) {