From 1ce804397fbd1fb9847d42f42294babea724ccf2 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 7 Nov 2012 15:07:12 -0500 Subject: [PATCH] Make dismissKeyguardLw use KeyguardViewMediator.dismiss(). It previously did some of the logic of dismiss() itself: checking to see if the KG is secure, and if not, proceeding to call keyguardDone() to actually hide everything. But now that we have the "bouncer" authentication UI, the WM should let the keyguard challenge the user to see if even a secure keyguard should be dismissed. (Insecure keyguards should behave exactly has they did before.) Unless, of course, the KVM is in a "dismissable" state, in which case it's safe to call keyguardDone() directly. (This can happen if the user has *already* authenticated and we're ending up in this codepath in response.) Bug: 7458531 Change-Id: I9571acf19f9bcc16bba7a826f916da7be8ca9c33 --- .../internal/policy/impl/PhoneWindowManager.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index d733369e17f6c..54bf20dafb804 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3899,14 +3899,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { } public void dismissKeyguardLw() { - if (mKeyguardMediator.isDismissable()) { - if (mKeyguardMediator.isShowing()) { - mHandler.post(new Runnable() { - public void run() { + if (mKeyguardMediator.isShowing()) { + mHandler.post(new Runnable() { + public void run() { + if (mKeyguardMediator.isDismissable()) { + // Can we just finish the keyguard straight away? mKeyguardMediator.keyguardDone(false, true); + } else { + // ask the keyguard to prompt the user to authenticate if necessary + mKeyguardMediator.dismiss(); } - }); - } + } + }); } }