mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Always pass true for ongoing with the first notification
ISSUE: #7977 PiperOrigin-RevId: 333726625
This commit is contained in:
parent
d1416aeb98
commit
ea57e5d28b
1 changed files with 5 additions and 2 deletions
|
|
@ -989,7 +989,6 @@ public class PlayerNotificationManager {
|
|||
Notification notification = builder.build();
|
||||
notificationManager.notify(notificationId, notification);
|
||||
if (!isNotificationStarted) {
|
||||
isNotificationStarted = true;
|
||||
context.registerReceiver(notificationBroadcastReceiver, intentFilter);
|
||||
if (notificationListener != null) {
|
||||
notificationListener.onNotificationStarted(notificationId, notification);
|
||||
|
|
@ -997,8 +996,12 @@ public class PlayerNotificationManager {
|
|||
}
|
||||
@Nullable NotificationListener listener = notificationListener;
|
||||
if (listener != null) {
|
||||
listener.onNotificationPosted(notificationId, notification, ongoing);
|
||||
// Always pass true for ongoing with the first notification to tell a service to go into
|
||||
// foreground even when paused.
|
||||
listener.onNotificationPosted(
|
||||
notificationId, notification, ongoing || !isNotificationStarted);
|
||||
}
|
||||
isNotificationStarted = true;
|
||||
}
|
||||
|
||||
// We're calling a deprecated listener method that we still want to notify.
|
||||
|
|
|
|||
Loading…
Reference in a new issue