Ignore requests to hide the keyguard if we are in the process of waking up.

This should fix a race condition that results in the screen waking up
and displaying nothing but wall paper

Bug b/2168660

Change-Id: I55bac0aaab8425cde282e7fc7e7c6b82217fbc9d
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java
index 34b5e3a..dc243c4 100644
--- a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -876,6 +876,10 @@
     private void handleHide() {
         synchronized (KeyguardViewMediator.this) {
             if (DEBUG) Log.d(TAG, "handleHide");
+            if (mWakeAndHandOff.isHeld()) {
+                Log.w(TAG, "attempt to hide the keyguard while waking, ignored");
+                return;
+            }
             // When we go away, tell the poewr manager to honor requests from userActivity.
             mRealPowerManager.enableUserActivity(true);