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

Commit 010aa311 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Exclude notifications with PROMOTED_ONGOING flag from being dismissed...

Merge "Exclude notifications with PROMOTED_ONGOING flag from being dismissed with their group summaries." into main
parents eccbb2c0 589f37d5
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,