Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 589f37d5 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Exclude notifications with PROMOTED_ONGOING flag from being dismissed with their group summaries.

Flag: android.app.ui_rich_ongoing
Test: presubmit
Fixes: 416047821
Change-Id: Icf11cf935602f664466ffd0a124e35213e97d15a
parent 7548a3e0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -928,6 +928,7 @@ public class NotifCollection implements Dumpable, PipelineDumpable {
        return entry.getSbn().getGroupKey().equals(dismissedGroupKey)
                && !entry.getSbn().getNotification().isGroupSummary()
                && !hasFlag(entry, Notification.FLAG_ONGOING_EVENT)
                && !hasFlag(entry, Notification.FLAG_PROMOTED_ONGOING)
                && !hasFlag(entry, Notification.FLAG_BUBBLE)
                && !hasFlag(entry, Notification.FLAG_NO_CLEAR)
                && (entry.getChannel() == null || !entry.getChannel().isImportantConversation())
+10 −1
Original line number Diff line number Diff line
@@ -11671,7 +11671,7 @@ public class NotificationManagerService extends SystemService {
            final StatusBarNotification childSbn = childR.getSbn();
            if (grouChildChecker.apply(childR, userId, pkg, groupKey)
                && (flagChecker == null || flagChecker.apply(childR.getFlags()))
                && (!childR.getChannel().isImportantConversation() || reason != REASON_CANCEL)) {
                && (!isPromotedOutOfGroup(childR) || reason != REASON_CANCEL)) {
                EventLogTags.writeNotificationCancel(callingUid, callingPid, pkg, childSbn.getId(),
                        childSbn.getTag(), userId, 0, 0, childReason, listenerName);
                notificationList.remove(i);
@@ -11682,6 +11682,15 @@ public class NotificationManagerService extends SystemService {
        }
    }
    /**
     * Certain notifications have attributes that causes SystemUI to *always* promote them out of
     * their group, i.e. make them a top-level notification in the shade. These notifications should
     * not be cancelled when the group is.
     */
    private boolean isPromotedOutOfGroup(NotificationRecord r) {
        return r.getChannel().isImportantConversation() || r.getNotification().isPromotedOngoing();
    }
    @GuardedBy("mNotificationLock")
    @NonNull
    List<NotificationRecord> findCurrentAndSnoozedGroupNotificationsLocked(String pkg,