From d7912d2f106053bf4965d137b436e0b5b863f184 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 30 Sep 2014 17:38:19 +0200 Subject: [PATCH] Don't play hint animations when dozing Bug: 17718416 Change-Id: I2c27b4ea479ee46612eb5284a2c872d03dc52ab0 --- .../systemui/statusbar/phone/NotificationPanelView.java | 4 +++- .../src/com/android/systemui/statusbar/phone/PanelView.java | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index b9efb224cba4b..26420e113c45c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1551,7 +1551,8 @@ public class NotificationPanelView extends PanelView implements @Override protected void onEdgeClicked(boolean right) { if ((right && getRightIcon().getVisibility() != View.VISIBLE) - || (!right && getLeftIcon().getVisibility() != View.VISIBLE)) { + || (!right && getLeftIcon().getVisibility() != View.VISIBLE) + || isDozing()) { return; } mHintAnimationRunning = true; @@ -1747,6 +1748,7 @@ public class NotificationPanelView extends PanelView implements updateKeyguardStatusBarVisibility(); } + @Override public boolean isDozing() { return mDozing; } 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 cacc2df7843ec..7cf7c104d41cf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -914,7 +914,9 @@ public abstract class PanelView extends FrameLayout { private boolean onMiddleClicked() { switch (mStatusBar.getBarState()) { case StatusBarState.KEYGUARD: - startUnlockHintAnimation(); + if (!isDozing()) { + startUnlockHintAnimation(); + } return true; case StatusBarState.SHADE_LOCKED: mStatusBar.goToKeyguard(); @@ -932,6 +934,8 @@ public abstract class PanelView extends FrameLayout { protected abstract void onEdgeClicked(boolean right); + protected abstract boolean isDozing(); + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println(String.format("[PanelView(%s): expandedHeight=%f maxPanelHeight=%d closing=%s" + " tracking=%s justPeeked=%s peekAnim=%s%s timeAnim=%s%s touchDisabled=%s"