From 8a2d4fc5be174fb200c788659d0a422564ae6f97 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Tue, 9 Sep 2014 15:46:35 -0400 Subject: Fix blank QS Panel after double tap on profile icon When handleShowDetailImpl is called twice in quick succession (show then not show), there is a race condition. If the second call comes in before the animation finishes, the second call will call setGridContentVisibility(true) before the onAnimationEnd callback calls setGridContentVisibility(false). At that point the grid is assumed to be visible when it isn't. To fix this the HideGridContentWhenDone listener removes itself as a listener when the animation is cancelled, this will avoid onAnimationEnd being called in this circumstance, leaving the grid visible (as it is assumed to be). Bug: 17424221 Change-Id: I67b84b669ebe0e061e4a2c7f98e8151c221ee4fb --- packages/SystemUI/src/com/android/systemui/qs/QSPanel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 6bfe0a4f6c58..437c243410e6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -525,6 +525,12 @@ public class QSPanel extends ViewGroup { }; private final AnimatorListenerAdapter mHideGridContentWhenDone = new AnimatorListenerAdapter() { + public void onAnimationCancel(Animator animation) { + // If we have been cancelled, remove the listener so that onAnimationEnd doesn't get + // called, this will avoid accidentally turning off the grid when we don't want to. + animation.removeListener(this); + }; + @Override public void onAnimationEnd(Animator animation) { setGridContentVisibility(false); -- cgit v1.2.3-59-g8ed1b