Merge "Fixed a leak of a notification when replying to a conversation" into pi-dev

This commit is contained in:
Selim Cinek
2018-08-20 17:58:25 +00:00
committed by Android (Google) Code Review

View File

@@ -667,9 +667,15 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
entry.row.getNotificationChildren(); entry.row.getNotificationChildren();
for (int i = 0; i < notificationChildren.size(); i++) { for (int i = 0; i < notificationChildren.size(); i++) {
ExpandableNotificationRow row = notificationChildren.get(i); ExpandableNotificationRow row = notificationChildren.get(i);
if ((row.getStatusBarNotification().getNotification().flags NotificationData.Entry childEntry = row.getEntry();
& Notification.FLAG_FOREGROUND_SERVICE) != 0) { boolean isForeground = (row.getStatusBarNotification().getNotification().flags
// the child is a foreground service notification which we can't remove! & 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; continue;
} }
row.setKeepInParent(true); row.setKeepInParent(true);