mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00
Reset MediaSession shuffle/repeat modes if player is null
- This is for consistency with PlayerControlView. - Also update PlayerNotificationManager notification if shuffle mode changes. This is for consistency with what happens when the repeat mode changes. By default the notification will be unchanged, but custom implementations can extend and then override createNotification, and given these modes change infrequently it feels like we can just do this. The alternative for achieving consistency would be to remove handling of repeat mode changes. Issue: #6582 PiperOrigin-RevId: 277925094
This commit is contained in:
parent
cc94ae7bfb
commit
accb31e489
@ -700,6 +700,9 @@ public final class MediaSessionConnector {
|
||||
/* position= */ 0,
|
||||
/* playbackSpeed= */ 0,
|
||||
/* updateTime= */ SystemClock.elapsedRealtime());
|
||||
|
||||
mediaSession.setRepeatMode(PlaybackStateCompat.REPEAT_MODE_NONE);
|
||||
mediaSession.setShuffleMode(PlaybackStateCompat.SHUFFLE_MODE_NONE);
|
||||
mediaSession.setPlaybackState(builder.build());
|
||||
return;
|
||||
}
|
||||
|
@ -1348,7 +1348,12 @@ public class PlayerNotificationManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRepeatModeChanged(int repeatMode) {
|
||||
public void onRepeatModeChanged(@Player.RepeatMode int repeatMode) {
|
||||
startOrUpdateNotification();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {
|
||||
startOrUpdateNotification();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user