From 43a60af53ca97cb0d7e3e26374636c67cce6ebb6 Mon Sep 17 00:00:00 2001 From: Joshua Tsuji Date: Fri, 10 Jan 2020 14:50:59 -0500 Subject: [PATCH] Check if the animation is null before trying to start it. Test: atest SystemUITests Bug: 147434271 Change-Id: I442afdfaca0744711a9d9fcacf84e778ea516308 --- .../systemui/bubbles/animation/PhysicsAnimationLayout.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java index 563a0a7e43e13..31656a00c3eda 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java @@ -961,6 +961,13 @@ public class PhysicsAnimationLayout extends FrameLayout { if (view != null) { final SpringAnimation animation = (SpringAnimation) view.getTag(getTagIdForProperty(property)); + + // If the animation is null, the view was probably removed from the layout before + // the animation started. + if (animation == null) { + return; + } + if (afterCallbacks != null) { animation.addEndListener(new OneTimeEndListener() { @Override