From b2e0f33ea42af11094a78ee7f90a702871b840a3 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 18 Aug 2017 12:24:38 -0700 Subject: [PATCH] Fixed a bug where a removed notification would stick around Because we going back to the keyguard, the translation was reset and the callback would not be called, leaving us with a stuck notification. Test: have only 1 notification in shade locked an swipe it away after doing a half-swipe first Change-Id: Iea2db4ff7efa2e84aa36cd13cfa8cfa1859d6892 Fixes: 64762751 --- .../SystemUI/src/com/android/systemui/SwipeHelper.java | 7 ++++++- .../statusbar/stack/NotificationStackScrollLayout.java | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index e3eaadd2c66cb..4b377153e558e 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -439,7 +439,12 @@ public class SwipeHelper implements Gefingerpoken { public void onAnimationEnd(Animator animation) { updateSwipeProgressFromOffset(animView, canBeDismissed); mDismissPendingMap.remove(animView); - if (!mCancelled) { + boolean wasRemoved = false; + if (animView instanceof ExpandableNotificationRow) { + ExpandableNotificationRow row = (ExpandableNotificationRow) animView; + wasRemoved = row.isRemoved(); + } + if (!mCancelled || wasRemoved) { mCallback.onChildDismissed(animView); } if (endAction != null) { 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 188f216009254..c2da72bb666e2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -4539,7 +4539,10 @@ public class NotificationStackScrollLayout extends ViewGroup anim.start(); } } else if (mMenuExposedView instanceof ExpandableNotificationRow) { - ((ExpandableNotificationRow) mMenuExposedView).resetTranslation(); + ExpandableNotificationRow row = (ExpandableNotificationRow) mMenuExposedView; + if (!row.isRemoved()) { + row.resetTranslation(); + } } mMenuExposedView = null; }