Partial fix for 2069703: Fix race condition in KeyguardViewManager.hide() that could result in a blank screen.

This fixes a race condition seen whenever show() is called before the timer in hide() triggers. This can happen
for example if the user hits "Emergency Dial" followed by the back button before the 0.5s timeout completes. The result
is a blank screen with no keyguard view and no means to recover on devices w/o a keyboard.

The bug caused us to sometimes remove the newly created KeyguardView instead of the old one, leaving the view empty.

The fix is to always remove the last view.
diff --git a/policy/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/com/android/internal/policy/impl/KeyguardViewManager.java
index 910df8d..bac2fcad 100644
--- a/policy/com/android/internal/policy/impl/KeyguardViewManager.java
+++ b/policy/com/android/internal/policy/impl/KeyguardViewManager.java
@@ -48,7 +48,7 @@
 
     private WindowManager.LayoutParams mWindowLayoutParams;
     private boolean mNeedsInput = false;
-    
+
     private FrameLayout mKeyguardHost;
     private KeyguardViewBase mKeyguardView;
 
@@ -154,7 +154,7 @@
             mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams);
         }
     }
-    
+
     /**
      * Reset the state of the view.
      */
@@ -218,15 +218,13 @@
             // Don't do this right away, so we can let the view continue to animate
             // as it goes away.
             if (mKeyguardView != null) {
-                final View lastView = mKeyguardView;
+                final KeyguardViewBase lastView = mKeyguardView;
+                mKeyguardView = null;
                 mKeyguardHost.postDelayed(new Runnable() {
                     public void run() {
                         synchronized (KeyguardViewManager.this) {
-                            if (mKeyguardView == lastView) {
-                                mKeyguardHost.removeView(mKeyguardView);
-                                mKeyguardView.cleanUp();
-                                mKeyguardView = null;
-                            }
+                            mKeyguardHost.removeView(lastView);
+                            lastView.cleanUp();
                         }
                     }
                 }, 500);