From 488b792eeeea359ba29addd6a202b5475ad1d18f Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 5 Aug 2014 21:12:02 +0200 Subject: [PATCH] Fix not being able to dismiss panel with single tap Bug: 16562847 Change-Id: Ic409b9dd23df7e79a20b83a8a63eaaf1f76b3dd0 --- .../android/systemui/statusbar/phone/PanelView.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 3c111b634765e..469a831e47a4d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -853,6 +853,12 @@ public abstract class PanelView extends FrameLayout { } } + private final Runnable mPostCollapseRunnable = new Runnable() { + @Override + public void run() { + collapse(); + } + }; private boolean onMiddleClicked() { switch (mStatusBar.getBarState()) { case StatusBarState.KEYGUARD: @@ -862,7 +868,10 @@ public abstract class PanelView extends FrameLayout { mStatusBar.goToKeyguard(); return true; case StatusBarState.SHADE: - collapse(); + + // This gets called in the middle of the touch handling, where the state is still + // that we are tracking the panel. Collapse the panel after this is done. + post(mPostCollapseRunnable); return false; default: return true;