From: Jorim Jaggi Date: Mon, 24 Oct 2016 22:40:06 +0000 (-0700) Subject: Make sure to call dismissKeyguard after setOccluded X-Git-Tag: android-x86-7.1-r1~66^2~226^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ec50931d884e0b8f13a5f3050d786275817a2d92;p=android-x86%2Fframeworks-base.git Make sure to call dismissKeyguard after setOccluded If we call it before, SystemUI will not dismiss the Keyguard as it is still occluded in that state. Change-Id: I15cf9cc43b9a2b747bfd224a6dfbd769eee19d69 Fixes: 32202560 --- diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index f027b941454d..74e720f360ac 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5293,18 +5293,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } else if (mDismissKeyguard != DISMISS_KEYGUARD_NONE) { mKeyguardHidden = false; - boolean willDismiss = false; + boolean dismissKeyguard = false; + final boolean trusted = mKeyguardDelegate.isTrusted(); if (mDismissKeyguard == DISMISS_KEYGUARD_START) { - final boolean trusted = mKeyguardDelegate.isTrusted(); - willDismiss = trusted && mKeyguardOccluded && mKeyguardDelegate != null - && mKeyguardDelegate.isShowing(); + final boolean willDismiss = trusted && mKeyguardOccluded + && mKeyguardDelegate != null && mKeyguardDelegate.isShowing(); if (willDismiss) { mCurrentlyDismissingKeyguard = true; } - - // Only launch the next keyguard unlock window once per window. - mHandler.post(() -> mKeyguardDelegate.dismiss( - trusted /* allowWhileOccluded */)); + dismissKeyguard = true; } // If we are currently dismissing Keyguard, there is no need to unocclude it. @@ -5315,6 +5312,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { | FINISH_LAYOUT_REDO_WALLPAPER; } } + + if (dismissKeyguard) { + // Only launch the next keyguard unlock window once per window. + mHandler.post(() -> mKeyguardDelegate.dismiss( + trusted /* allowWhileOccluded */)); + } } else { mWinDismissingKeyguard = null; mSecureDismissingKeyguard = false;