Don't set negative values to setWhen()
When the 'when' timer of the notification is disabled `DefaultMediaNotificationProvider` may set `C.TIME_UNSET` as the time. Users reported problems on some devices with this and the docs ask for an event time that probably shouldn't be a negative number. This change sets `0L` instead of `C.TIME_UNSET` when the timer is disabled. Issue: androidx/media#903 #minor-release PiperOrigin-RevId: 594451074
This commit is contained in:
parent
846ace16aa
commit
426bc94090
@ -117,6 +117,9 @@
|
|||||||
[#802](https://github.com/androidx/media/issues/802)).
|
[#802](https://github.com/androidx/media/issues/802)).
|
||||||
* Fix broadcasting `notifyChildrenChanged` for legacy controllers
|
* Fix broadcasting `notifyChildrenChanged` for legacy controllers
|
||||||
([#644](https://github.com/androidx/media/issues/644)).
|
([#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:
|
* UI:
|
||||||
* Fix issue where forward and rewind buttons are not visible when used
|
* Fix issue where forward and rewind buttons are not visible when used
|
||||||
with Material Design in a BottomSheetDialogFragment
|
with Material Design in a BottomSheetDialogFragment
|
||||||
|
@ -375,7 +375,7 @@ public class DefaultMediaNotificationProvider implements MediaNotification.Provi
|
|||||||
long playbackStartTimeMs = getPlaybackStartTimeEpochMs(player);
|
long playbackStartTimeMs = getPlaybackStartTimeEpochMs(player);
|
||||||
boolean displayElapsedTimeWithChronometer = playbackStartTimeMs != C.TIME_UNSET;
|
boolean displayElapsedTimeWithChronometer = playbackStartTimeMs != C.TIME_UNSET;
|
||||||
builder
|
builder
|
||||||
.setWhen(playbackStartTimeMs)
|
.setWhen(displayElapsedTimeWithChronometer ? playbackStartTimeMs : 0L)
|
||||||
.setShowWhen(displayElapsedTimeWithChronometer)
|
.setShowWhen(displayElapsedTimeWithChronometer)
|
||||||
.setUsesChronometer(displayElapsedTimeWithChronometer);
|
.setUsesChronometer(displayElapsedTimeWithChronometer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user