From be5b4e19693cf6bc481bb3d845bbead03614f302 Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Tue, 23 Jun 2020 17:51:53 -0400 Subject: [PATCH] Use reference equality for AnimatableScaleMatrix equals(). When we recreate the stack, we also create a new AnimatableScaleMatrix and get a PhysicsAnimator instance for it. Since the matrices can have identical values, we sometimes end up getting the animator instance for the previous stack's matrix if it hasn't yet been garbage collected. This means we're animating a matrix that has no effect on the current stack, so the expanded view scale stays at 0% forever. Bug: 159719888 Test: this one is really hard since it's nondeterministic, but just create/dismiss bubbles a lot Change-Id: Ib5e390caba0ac621ccf7a1da71adc9d15f51fd65 --- .../systemui/bubbles/animation/AnimatableScaleMatrix.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/AnimatableScaleMatrix.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/AnimatableScaleMatrix.java index ae78336347940..07acb710c6d7c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/AnimatableScaleMatrix.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/AnimatableScaleMatrix.java @@ -134,4 +134,11 @@ public class AnimatableScaleMatrix extends Matrix { public float getPivotY() { return mPivotY; } + + @Override + public boolean equals(Object obj) { + // Use object equality to allow this matrix to be used as a map key (which is required for + // PhysicsAnimator's animator caching). + return obj == this; + } }