From ed80f3f01e0c9eba6258f5ba3de356e3de395df4 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 15 Oct 2013 17:48:15 -0700 Subject: [PATCH] Fix issue where keyguard reports a valid token but doesn't draw This fixes an issue where keyguard isn't showing but tells PhoneWindowManager to wait anyway. The fix is to send a null token when keyguard isn't showing. Fixes bug 11216030 Change-Id: I4985fe50c63819415d9d5a1de0b741c8aa6391d8 --- .../com/android/keyguard/KeyguardViewManager.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java index a0cad8444ea91..fd7cae66f0067 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java @@ -431,17 +431,13 @@ public class KeyguardViewManager { public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback) { if (DEBUG) Log.d(TAG, "onScreenTurnedOn()"); mScreenOn = true; - final IBinder token; - // If keyguard is disabled, we need to inform PhoneWindowManager with a null + // If keyguard is not showing, we need to inform PhoneWindowManager with a null // token so it doesn't wait for us to draw... - final boolean disabled = - mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure(); - if (mKeyguardHost == null || disabled) { - token = null; - } else { - token = mKeyguardHost.getWindowToken(); - } + final IBinder token = isShowing() ? mKeyguardHost.getWindowToken() : null; + + if (DEBUG && token == null) Slog.v(TAG, "send wm null token: " + + (mKeyguardHost == null ? "host was null" : "not showing")); if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOn();