diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7e697a693e4..5b32e1bb581 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -117,6 +117,9 @@ [#802](https://github.com/androidx/media/issues/802)). * Fix broadcasting `notifyChildrenChanged` for legacy controllers ([#644](https://github.com/androidx/media/issues/644)). + * Fix a bug where setting a negative time for a disabled `setWhen` timer + of the notification caused a crash on some devices + ([#903](https://github.com/androidx/media/issues/903)). * UI: * Fix issue where forward and rewind buttons are not visible when used with Material Design in a BottomSheetDialogFragment diff --git a/libraries/session/src/main/java/androidx/media3/session/DefaultMediaNotificationProvider.java b/libraries/session/src/main/java/androidx/media3/session/DefaultMediaNotificationProvider.java index e9d77e75f7c..f6f4696a083 100644 --- a/libraries/session/src/main/java/androidx/media3/session/DefaultMediaNotificationProvider.java +++ b/libraries/session/src/main/java/androidx/media3/session/DefaultMediaNotificationProvider.java @@ -375,7 +375,7 @@ public final MediaNotification createNotification( long playbackStartTimeMs = getPlaybackStartTimeEpochMs(player); boolean displayElapsedTimeWithChronometer = playbackStartTimeMs != C.TIME_UNSET; builder - .setWhen(playbackStartTimeMs) + .setWhen(displayElapsedTimeWithChronometer ? playbackStartTimeMs : 0L) .setShowWhen(displayElapsedTimeWithChronometer) .setUsesChronometer(displayElapsedTimeWithChronometer);