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
This commit is contained in:
Jorim Jaggi
2015-08-10 18:20:43 -07:00
parent 968fc3ab75
commit a4b51bc4fd

View File

@@ -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,