From 127b3d35411f614478f76be8c0b367d6d6160345 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Sun, 23 Jan 2022 16:40:52 +0000 Subject: [PATCH] Always execute the dismiss end runnable on silent header clear. This fixes an edge case where the runAfter runnable was dropped, breaking the dismiss animation. On a clear animation, NSSL would use the runAfter runnable of the topmost view in the shade being animated out. This meant that if the silent header had buggily become invisible, any clear animation which didn't affect alerting notifications (e.g. every "clear silent" animation) would result in performing the animations but NOT performing the dismiss action at the end of the animation. With this fix, that buggy situation results in dismissing before the animation completes, which looks less than ideal, but avoids the bugged out post-dismiss state. Fixes: 211161593 Test: manual testing making the silent view re-add Change-Id: I378ec66ba622c521435eef2e7b032c1fed10f4ee --- .../statusbar/notification/row/StackScrollerDecorView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java index 9c755e970a0f8..3cdaa9ad5f874 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java @@ -105,6 +105,9 @@ public abstract class StackScrollerDecorView extends ExpandableView { runAfter.run(); }; setViewVisible(mContent, visible, animate, endRunnable); + } else if (runAfter != null) { + // Execute the runAfter runnable immediately if there's no animation to perform. + runAfter.run(); } if (!mContentAnimating) { @@ -228,7 +231,7 @@ public abstract class StackScrollerDecorView extends ExpandableView { Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener) { // TODO: Use duration - setContentVisible(false); + setContentVisible(false, true /* animate */, onFinishedRunnable); return 0; }