From b2a872906c04bb36d622b952881667e71f76c52e Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Mon, 13 Feb 2017 15:05:03 +0100 Subject: [PATCH] AOD: show AOD1 instead of AOD2 on double tap Bug: 30876804 Test: Have a notification showing, turn off screen, double-tap to Ambient Display, observe that device shows only the time and notification icon, not the expanded notification Change-Id: Ic9b9fc392b67b0411588c1287cdf61ca2397990d --- .../statusbar/notification/VisualStabilityManager.java | 3 +++ .../com/android/systemui/statusbar/phone/StatusBar.java | 8 ++++++-- .../statusbar/stack/NotificationStackScrollLayout.java | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/VisualStabilityManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/VisualStabilityManager.java index a4e591625a95c..8dab06908001e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/VisualStabilityManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/VisualStabilityManager.java @@ -72,6 +72,9 @@ public class VisualStabilityManager implements OnHeadsUpChangedListener { * @param pulsing whether we are currently pulsing for ambient display. */ public void setPulsing(boolean pulsing) { + if (mPulsing == pulsing) { + return; + } mPulsing = pulsing; updateReorderingAllowed(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 365d991651214..6965c72cfd9f4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -5005,8 +5005,12 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void onPulseStarted() { callback.onPulseStarted(); - mStackScroller.setPulsing(true); - mVisualStabilityManager.setPulsing(true); + if (!mHeadsUpManager.getAllEntries().isEmpty()) { + // Only pulse the stack scroller if there's actually something to show. + // Otherwise just show the always-on screen. + mStackScroller.setPulsing(true); + mVisualStabilityManager.setPulsing(true); + } } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 11927729d4720..897bb235e7ba7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -4026,6 +4026,9 @@ public class NotificationStackScrollLayout extends ViewGroup } public void setPulsing(boolean pulsing) { + if (mPulsing == pulsing) { + return; + } mPulsing = pulsing; updateNotificationAnimationStates(); updateContentHeight();