From 29deb334cd895414e5bd43fabbc9532f9724bcf0 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 9 Nov 2015 14:33:20 +0100 Subject: [PATCH] Reset mAppTransitionAnimationSpecs so they are only used once Because we didn't reset it after sending it to window manager, they were used again in the next transition, leading to a wrong animation. Also fix a bug where we waited forever because getAppTransitionAnimationSpecs returned null. Bug: 25583739 Change-Id: Ifcccf2d3cee649f66b4ded1d92c059acfa02ba5b --- .../systemui/recents/views/RecentsView.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 5f94fa76f380..8729aa0fbf6f 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -79,6 +79,13 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV private static final boolean DEBUG = false; private static final boolean ADD_HEADER_BITMAP = true; + + /** + * Special value for {@link #mAppTransitionAnimationSpecs}: Indicate that we are currently + * waiting for the specs to be retrieved. + */ + private static final List SPECS_WAITING = new ArrayList<>(); + private int mStackViewVisibility = View.VISIBLE; /** The RecentsView callbacks */ @@ -109,7 +116,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV @GuardedBy("this") - List mAppTransitionAnimationSpecs; + List mAppTransitionAnimationSpecs = SPECS_WAITING; public RecentsView(Context context) { super(context); @@ -439,7 +446,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } }); synchronized (RecentsView.this) { - while (mAppTransitionAnimationSpecs == null) { + while (mAppTransitionAnimationSpecs == SPECS_WAITING) { try { RecentsView.this.wait(); } catch (InterruptedException e) {} @@ -449,7 +456,9 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } AppTransitionAnimationSpec[] specs = new AppTransitionAnimationSpec[mAppTransitionAnimationSpecs.size()]; - return mAppTransitionAnimationSpecs.toArray(specs); + mAppTransitionAnimationSpecs.toArray(specs); + mAppTransitionAnimationSpecs = SPECS_WAITING; + return specs; } } }; -- GitLab