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

Commit 64b276d0 authored by Christoph Studer's avatar Christoph Studer Committed by Android (Google) Code Review
Browse files

Merge "SysUI: Filter notification group children on connect"

parents 3cf4a379 5b63826f
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -297,6 +297,10 @@ public abstract class BaseStatusBar extends SystemUI implements
                @Override
                public void run() {
                    for (StatusBarNotification sbn : notifications) {
                        if (shouldFilterOut(sbn.getNotification())) {
                            if (DEBUG) Log.d(TAG, "Ignoring notification: " + sbn);
                            continue;
                        }
                        addNotification(sbn, currentRanking);
                    }
                }
@@ -313,16 +317,11 @@ public abstract class BaseStatusBar extends SystemUI implements
                    Notification n = sbn.getNotification();
                    boolean isUpdate = mNotificationData.findByKey(sbn.getKey()) != null
                            || isHeadsUp(sbn.getKey());
                    boolean isGroupedChild = n.getGroup() != null
                            && (n.flags & Notification.FLAG_GROUP_SUMMARY) == 0;
                    if (isGroupedChild) {
                        if (DEBUG) {
                            Log.d(TAG, "Ignoring group child: " + sbn);
                        }
                        // Don't show grouped notifications. If this is an
                        // update, i.e. the notification existed before but
                        // wasn't a group child, remove the old instance.
                        // Otherwise just update the ranking.
                    if (shouldFilterOut(n)) {
                        if (DEBUG) Log.d(TAG, "Ignoring notification: " + sbn);
                        // If this is an update, i.e. the notification existed
                        // before but wasn't filtered out, remove the old
                        // instance. Otherwise just update the ranking.
                        if (isUpdate) {
                            removeNotification(sbn.getKey(), rankingMap);
                        } else {
@@ -361,6 +360,12 @@ public abstract class BaseStatusBar extends SystemUI implements
                }
            });
        }

        private boolean shouldFilterOut(Notification n) {
            // Don't accept group children.
            return n.getGroup() != null
                    && (n.flags & Notification.FLAG_GROUP_SUMMARY) == 0;
        }
    };

    private void updateCurrentProfilesCache() {