From 8c7e47f95d5bdd06b4040528d8ac53818ce60745 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 17 Feb 2016 10:39:31 -0500 Subject: [PATCH] Protect against monkey crash Bug: 27164002 Change-Id: Ic1b68a55a136106010b6df07766a96533683eece --- .../systemui/qs/customize/QSCustomizer.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java index edcccaca2a14f..81e15818aa1c8 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java @@ -90,16 +90,20 @@ public class QSCustomizer extends LinearLayout implements AnimatorListener, OnCl } public void show(int x, int y) { - isShown = true; - mPhoneStatusBar.getStatusBarWindow().addView(this); - setTileSpecs(); - mClipper.animateCircularClip(x, y, true, this); - new TileQueryHelper(mContext, mHost).setListener(mTileAdapter); + if (!isShown) { + isShown = true; + mPhoneStatusBar.getStatusBarWindow().addView(this); + setTileSpecs(); + mClipper.animateCircularClip(x, y, true, this); + new TileQueryHelper(mContext, mHost).setListener(mTileAdapter); + } } public void hide(int x, int y) { - isShown = false; - mClipper.animateCircularClip(x, y, false, this); + if (isShown) { + isShown = false; + mClipper.animateCircularClip(x, y, false, this); + } } public boolean isCustomizing() {