From 3bad9a6caf99031eb6cef2f437ca60e6723bc60a Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Wed, 26 Jul 2017 17:29:59 +0200 Subject: [PATCH] HeadsUpManager: escalate via wakefulness lifecycle instead of broadcast Fixes an issue where heads up notifications were escalated too late, which caused notifications not to show on ambient display if they came in after the device started dozing but before the SCREEN_OFF intent came in. Instead, we now escalate when we start going to sleep. Note that SCREEN_OFF is dispatched on the wakefulness lifecycle, not the screen lifecycle. Change-Id: Ied73161d1007d1c65c31e8c5a6f660124a1f4385 Fixes: 63992199 Test: Receive notification right when the display turns off. Make sure AOD does not show in a weird state. --- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 c0503be41ff14..d39ec0a0d9fb7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -3712,7 +3712,6 @@ public class StatusBar extends SystemUI implements DemoMode, } } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { - notifyHeadsUpScreenOff(); finishBarAnimations(); resetUserExpandedStates(); } @@ -5153,6 +5152,7 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void onStartedGoingToSleep() { + notifyHeadsUpGoingToSleep(); dismissVolumeDialog(); } @@ -7240,7 +7240,7 @@ public class StatusBar extends SystemUI implements DemoMode, setAreThereNotifications(); } - protected void notifyHeadsUpScreenOff() { + protected void notifyHeadsUpGoingToSleep() { maybeEscalateHeadsUp(); }