OSDN Git Service

Fix issue where keyguard reports a valid token but doesn't draw
authorJim Miller <jaggies@google.com>
Wed, 16 Oct 2013 00:48:15 +0000 (17:48 -0700)
committerJim Miller <jaggies@google.com>
Wed, 16 Oct 2013 00:50:17 +0000 (17:50 -0700)
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

packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

index a0cad84..fd7cae6 100644 (file)
@@ -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();