From a4b51bc4fd4a3e40871fb8d77c2173f0c38bd162 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 10 Aug 2015 18:20:43 -0700 Subject: Fix Keyguard drawn timeout The timeout for waiting for Keyguard drawn was posted at the wrong place. If the screen was turning on but the device wasn't waking up, like in doze mode, we didn't post the timeout, thus, if Keyguard wouldn't notify us, we would never unblock the screen. This doesn't really cause a user visible bug but it *could* prevent the screen from turning on if Keyguard doesn't behave nicely. Put it at the right place so I can sleep better. Bug: 21855614 Change-Id: Icda31399261b4ee80c292ce09a0858b0127e2999 --- .../core/java/com/android/server/policy/PhoneWindowManager.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index c4ff277..bfd1fed 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5492,10 +5492,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { // may happen in a future call to goToSleep. synchronized (mLock) { mAwake = true; - if (mKeyguardDelegate != null) { - mHandler.removeMessages(MSG_KEYGUARD_DRAWN_TIMEOUT); - mHandler.sendEmptyMessageDelayed(MSG_KEYGUARD_DRAWN_TIMEOUT, 1000); - } updateWakeGestureListenerLp(); updateOrientationListenerLp(); @@ -5585,6 +5581,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { mScreenOnListener = screenOnListener; if (mKeyguardDelegate != null) { + mHandler.removeMessages(MSG_KEYGUARD_DRAWN_TIMEOUT); + mHandler.sendEmptyMessageDelayed(MSG_KEYGUARD_DRAWN_TIMEOUT, 1000); mKeyguardDelegate.onScreenTurningOn(mKeyguardDrawnCallback); } else { if (DEBUG_WAKEUP) Slog.d(TAG, -- cgit v1.1