Merge "SIM PIN Retry attempts display on Bootup."
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
index 9dcef3a..4322a5c 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
@@ -59,12 +59,7 @@
         @Override
         public void onSimStateChanged(int subId, int slotId, State simState) {
            if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
-           switch (simState) {
-               case NOT_READY:
-               case ABSENT:
-                   closeKeyGuard();
-                   break;
-           }
+           resetState();
        };
     };
 
@@ -255,7 +250,12 @@
                             }
                             resetPasswordText(true /* animate */);
                             if (result == PhoneConstants.PIN_RESULT_SUCCESS) {
-                                closeKeyGuard();
+                                KeyguardUpdateMonitor.getInstance(getContext())
+                                        .reportSimUnlocked(mSubId);
+                                mRemainingAttempts = -1;
+                                if (mCallback != null) {
+                                    mCallback.dismiss(true);
+                                }
                             } else {
                                 mShowDefaultMessage = false;
                                 if (result == PhoneConstants.PIN_PASSWORD_INCORRECT) {
@@ -298,16 +298,6 @@
         return false;
     }
 
-    private void closeKeyGuard() {
-        if (DEBUG) Log.d(TAG, "closeKeyGuard: Verification Completed, closing Keyguard.");
-        mRemainingAttempts = -1;
-        KeyguardUpdateMonitor.getInstance(getContext())
-                         .reportSimUnlocked(mSubId);
-        mCallback.dismiss(true);
-        mShowDefaultMessage = true;
-        reset();
-    }
-
     private void showDefaultMessage() {
         KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
         mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED);