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

Commit 038e259c authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a leak of a notification when replying to a conversation

When replying to a child in a group, the notification could get
removed, but forced to stay in the parent. This behavior doesn't
make sense if we're keeping around the notification.

Change-Id: I920eded257726fe8536f769357a5736ebf076051
Fixes: 112714177
Test: add group of 2, reply on child, observe no leak
parent 5cd354c8
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -667,9 +667,15 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
                    entry.row.getNotificationChildren();
            for (int i = 0; i < notificationChildren.size(); i++) {
                ExpandableNotificationRow row = notificationChildren.get(i);
                if ((row.getStatusBarNotification().getNotification().flags
                        & Notification.FLAG_FOREGROUND_SERVICE) != 0) {
                    // the child is a foreground service notification which we can't remove!
                NotificationData.Entry childEntry = row.getEntry();
                boolean isForeground = (row.getStatusBarNotification().getNotification().flags
                        & Notification.FLAG_FOREGROUND_SERVICE) != 0;
                boolean keepForReply = FORCE_REMOTE_INPUT_HISTORY
                        && (shouldKeepForRemoteInput(childEntry)
                                || shouldKeepForSmartReply(childEntry));
                if (isForeground || keepForReply) {
                    // the child is a foreground service notification which we can't remove or it's
                    // a child we're keeping around for reply!
                    continue;
                }
                row.setKeepInParent(true);