From ad35f8836273f994c99d75af3243e8a8e730ec9e Mon Sep 17 00:00:00 2001 From: Robert Snoeberger Date: Thu, 24 Oct 2019 13:35:31 -0400 Subject: [PATCH] Only help with HUNing notifications Fixes: 143290550 Test: Receive notification. Swipe away in shade. In java heap dump, check that HeadsUpTouchHelper#mPickedChild isn't retaining the ExpandableNotificationRow for the dismissed notification. Change-Id: I46ff64d7c1c72eb8ae796daec699f7d34c9df0b8 --- .../systemui/statusbar/phone/HeadsUpTouchHelper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java index dd200da56d20c..7f31f3db45072 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java @@ -77,9 +77,12 @@ public class HeadsUpTouchHelper implements Gefingerpoken { ExpandableView child = mCallback.getChildAtRawPosition(x, y); mTouchingHeadsUpView = false; if (child instanceof ExpandableNotificationRow) { - mPickedChild = (ExpandableNotificationRow) child; + ExpandableNotificationRow pickedChild = (ExpandableNotificationRow) child; mTouchingHeadsUpView = !mCallback.isExpanded() - && mPickedChild.isHeadsUp() && mPickedChild.isPinned(); + && pickedChild.isHeadsUp() && pickedChild.isPinned(); + if (mTouchingHeadsUpView) { + mPickedChild = pickedChild; + } } else if (child == null && !mCallback.isExpanded()) { // We might touch above the visible heads up child, but then we still would // like to capture it.