Skip to content

Commit

Permalink
Update notification play/pause button with matching player state
Browse files Browse the repository at this point in the history
Issue: #192
PiperOrigin-RevId: 508649684
  • Loading branch information
tianyif authored and christosts committed Feb 10, 2023
1 parent 574424f commit e1d12fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
([#233](https://github.com/androidx/media/issues/233)).
* Make `QueueTimeline` more robust in case of a shady legacy session state
([#241](https://github.com/androidx/media/issues/241)).
* Fix a bug where notification play/pause button doesn't update with
player state ([#192](https://github.com/androidx/media/issues/192)).
* Metadata:
* Parse multiple null-separated values from ID3 frames, as permitted by
ID3 v2.4.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ private void updateNotificationInternal(
if (startInForegroundRequired) {
startForeground(mediaNotification);
} else {
maybeStopForegroundService(/* removeNotifications= */ false);
// Notification manager has to be updated first to avoid missing updates
// (https://github.com/androidx/media/issues/192).
notificationManagerCompat.notify(
mediaNotification.notificationId, mediaNotification.notification);
maybeStopForegroundService(/* removeNotifications= */ false);
}
}

Expand Down

0 comments on commit e1d12fc

Please sign in to comment.