From 24813b0dd5b6b0d7dead4e748ae9f4bbfa0040e0 Mon Sep 17 00:00:00 2001 From: Dan Sandler Date: Thu, 14 Jan 2016 15:49:36 -0500 Subject: [PATCH] Stop leaking Notifications when they change groupKeys. If a Notification changes groups (either from one group to another, or gets a group key for the first time, which takes it out of its implicit singleton group) it should be removed from the old group in NotificationGroupManager's mGroupMap and re-inserted under the new one. Unfortunately we were passing the *new* notification in the oldNotification argument, so we would always attempt (and fail) to remove it from the *new* group, leaving a strong reference to the Notification inside mGroupMap under an obsolete group key. Bug: 26561365 Change-Id: Ie5cdceb4f843dbd363652e00fbc0f3ac6f6ef247 --- .../SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 9ff86ebf88aa..f88b2339838c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1914,8 +1914,9 @@ public abstract class BaseStatusBar extends SystemUI implements boolean shouldInterrupt = shouldInterrupt(entry, notification); boolean alertAgain = alertAgain(entry, n); + final StatusBarNotification oldNotification = entry.notification; entry.notification = notification; - mGroupManager.onEntryUpdated(entry, entry.notification); + mGroupManager.onEntryUpdated(entry, oldNotification); boolean updateSuccessful = false; if (applyInPlace) { -- 2.11.0