summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff DeCew <jeffdq@google.com>2022-01-13 21:01:11 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-01-28 01:20:05 +0000
commit878e9322034d9de4f4b87a61b24e4ba4af908d5f (patch)
tree26cc84310ddc45f9f8f5c8fe047b6c8c64f14061
parent5ce74ca4688558052279299f13ed8cc45d87c2a4 (diff)
downloadbase-878e9322034d9de4f4b87a61b24e4ba4af908d5f.tar.gz
Fix the animation glitch when NSSL adds and removes a HUN in the same frame.
Bug: 185680162 Fixes: 213876313 Test: visual inspection when legacy pipeline initiates a group alert transfer Merged-In: I755fff6944da0699d9cb7e6b2456e4811f7888d5 Change-Id: I755fff6944da0699d9cb7e6b2456e4811f7888d5 (cherry picked from commit 357207971089bf3c91e27b6304c18e175f215cfb) (cherry picked from commit f87c4e7bdcb5ad811df96fd999955b3041d49e39) Merged-In:I755fff6944da0699d9cb7e6b2456e4811f7888d5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 73a48c3b5cb0..c14e2f96320c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -130,6 +130,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
public static final float BACKGROUND_ALPHA_DIMMED = 0.7f;
private static final String TAG = "StackScroller";
+ private static final boolean SPEW = Log.isLoggable(TAG, Log.VERBOSE);
// Usage:
// adb shell setprop persist.debug.nssl true && adb reboot
@@ -3156,6 +3157,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
AnimationEvent event = new AnimationEvent(row, type);
event.headsUpFromBottom = onBottom;
mAnimationEvents.add(event);
+ if (SPEW) {
+ Log.v(TAG, "Generating HUN animation event: "
+ + " isHeadsUp=" + isHeadsUp
+ + " type=" + type
+ + " onBottom=" + onBottom
+ + " row=" + row.getEntry().getKey());
+ }
}
mHeadsUpChangeAnimations.clear();
mAddedHeadsUpChildren.clear();
@@ -4679,7 +4687,22 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
public void generateHeadsUpAnimation(ExpandableNotificationRow row, boolean isHeadsUp) {
- if (mAnimationsEnabled && (isHeadsUp || mHeadsUpGoingAwayAnimationsAllowed)) {
+ final boolean add = mAnimationsEnabled && (isHeadsUp || mHeadsUpGoingAwayAnimationsAllowed);
+ if (SPEW) {
+ Log.v(TAG, "generateHeadsUpAnimation:"
+ + " willAdd=" + add
+ + " isHeadsUp=" + isHeadsUp
+ + " row=" + row.getEntry().getKey());
+ }
+ if (add) {
+ // If we're hiding a HUN we just started showing THIS FRAME, then remove that event,
+ // and do not add the disappear event either.
+ if (!isHeadsUp && mHeadsUpChangeAnimations.remove(new Pair<>(row, true))) {
+ if (SPEW) {
+ Log.v(TAG, "generateHeadsUpAnimation: previous hun appear animation cancelled");
+ }
+ return;
+ }
mHeadsUpChangeAnimations.add(new Pair<>(row, isHeadsUp));
mNeedsAnimation = true;
if (!mIsExpanded && !mWillExpand && !isHeadsUp) {