From 4757c8ccf83d4391255273529aba8feb9ccd4a21 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Tue, 18 Jul 2017 15:50:41 +0200 Subject: [PATCH] Keyguard: only show after screen fully turned off Fixes an issue where the keyguard was displayed before the screen was turned off fully, causing the AOD screen to briefly show during the screen off animation. Change-Id: Idc4621995bd67c1db255fab5a8de60d3aeef5d18 Fixes: 63526727 Test: Turn screen off. Make sure the AOD clock is not visible --- .../android/systemui/statusbar/phone/StatusBar.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 cc4119ed0b1d4..e90d1c1e27b55 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -4199,10 +4199,7 @@ public class StatusBar extends SystemUI implements DemoMode, public void showKeyguard() { mKeyguardRequested = true; - // Unconditionally show keyguard again. There's some logic that relies on this - // being called even when the keyguard is already showing, e.g. for updating - // sensitiveness of notifications and making sure the panels are expanded. - showKeyguardImpl(); + updateIsKeyguard(); } public boolean hideKeyguard() { @@ -4222,7 +4219,12 @@ public class StatusBar extends SystemUI implements DemoMode, updatePanelExpansionForKeyguard(); } if (shouldBeKeyguard) { - showKeyguardImpl(); + if (isGoingToSleep() + && mScreenLifecycle.getScreenState() == ScreenLifecycle.SCREEN_TURNING_OFF) { + // Delay showing the keyguard until screen turned off. + } else { + showKeyguardImpl(); + } } else { return hideKeyguardImpl(); }