Skip to content

Commit 1ce8043

Browse files
committed
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
1 parent b524f4b commit 1ce8043

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3899,14 +3899,18 @@ public boolean inKeyguardRestrictedKeyInputMode() {
38993899
}
39003900

39013901
public void dismissKeyguardLw() {
3902-
if (mKeyguardMediator.isDismissable()) {
3903-
if (mKeyguardMediator.isShowing()) {
3904-
mHandler.post(new Runnable() {
3905-
public void run() {
3902+
if (mKeyguardMediator.isShowing()) {
3903+
mHandler.post(new Runnable() {
3904+
public void run() {
3905+
if (mKeyguardMediator.isDismissable()) {
3906+
// Can we just finish the keyguard straight away?
39063907
mKeyguardMediator.keyguardDone(false, true);
3908+
} else {
3909+
// ask the keyguard to prompt the user to authenticate if necessary
3910+
mKeyguardMediator.dismiss();
39073911
}
3908-
});
3909-
}
3912+
}
3913+
});
39103914
}
39113915
}
39123916

0 commit comments

Comments
 (0)