From f306d9b498c2c81ad52083a0825e037f2757daf7 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 21 Feb 2017 11:45:13 -0800 Subject: [PATCH] Fixed some notification leaks Since we're now allowing heads-up on the lockscreen the addedHeadsUpChildren list would fill up, even if animations were not enabled. This also fixes that the ExpandHelper and the DragDownHelper would not realease the view on up. Change-Id: I8c1b54ff4b034a8f4f2219534a707bbd792b8efa Fixes: 35375214 --- packages/SystemUI/src/com/android/systemui/ExpandHelper.java | 2 ++ .../src/com/android/systemui/statusbar/DragDownHelper.java | 2 ++ .../systemui/statusbar/stack/NotificationStackScrollLayout.java | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java index 8141b288ddee1..0b0ea72053d35 100644 --- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java +++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java @@ -571,6 +571,7 @@ public class ExpandHelper implements Gefingerpoken { public void onAnimationEnd(Animator animation) { if (!mCancelled) { mCallback.setUserExpandedChild(scaledView, expand); + mScaler.setView(null); } else { mCallback.setExpansionCancelled(scaledView); } @@ -592,6 +593,7 @@ public class ExpandHelper implements Gefingerpoken { } mCallback.setUserExpandedChild(mResizedView, nowExpanded); mCallback.setUserLockedChild(mResizedView, false); + mScaler.setView(null); } mExpanding = false; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java index 19132da9b3bdb..334991fd3516d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java @@ -133,6 +133,7 @@ public class DragDownHelper implements Gefingerpoken { mDragDownCallback.setEmptyDragAmount(0f); } else { mCallback.setUserLockedChild(mStartingChild, false); + mStartingChild = null; } mDraggingDown = false; } else { @@ -214,6 +215,7 @@ public class DragDownHelper implements Gefingerpoken { mFalsingManager.onNotificatonStopDraggingDown(); if (mStartingChild != null) { cancelExpansion(mStartingChild); + mStartingChild = null; } else { cancelExpansion(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index dd4e876604f26..6ee7d4a8fec25 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2785,7 +2785,7 @@ public class NotificationStackScrollLayout extends ViewGroup } mNeedsAnimation = true; } - if (isHeadsUp(child) && !mChangePositionInProgress) { + if (isHeadsUp(child) && mAnimationsEnabled && !mChangePositionInProgress) { mAddedHeadsUpChildren.add(child); mChildrenToAddAnimated.remove(child); }