mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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();
|
Notification notification = builder.build();
|
||||||
notificationManager.notify(notificationId, notification);
|
notificationManager.notify(notificationId, notification);
|
||||||
if (!isNotificationStarted) {
|
if (!isNotificationStarted) {
|
||||||
isNotificationStarted = true;
|
|
||||||
context.registerReceiver(notificationBroadcastReceiver, intentFilter);
|
context.registerReceiver(notificationBroadcastReceiver, intentFilter);
|
||||||
if (notificationListener != null) {
|
if (notificationListener != null) {
|
||||||
notificationListener.onNotificationStarted(notificationId, notification);
|
notificationListener.onNotificationStarted(notificationId, notification);
|
||||||
|
|
@ -997,8 +996,12 @@ public class PlayerNotificationManager {
|
||||||
}
|
}
|
||||||
@Nullable NotificationListener listener = notificationListener;
|
@Nullable NotificationListener listener = notificationListener;
|
||||||
if (listener != null) {
|
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.
|
// We're calling a deprecated listener method that we still want to notify.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue