AI 144245: Fix merge conflict for megering in the CDMA changes in to master from donutburger.

Automated import of CL 144245
diff --git a/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
index 3a25d38..eb25a092 100644
--- a/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
+++ b/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
@@ -34,7 +34,7 @@
 import static android.provider.Telephony.Intents.EXTRA_SHOW_SPN;
 import static android.provider.Telephony.Intents.EXTRA_SPN;
 import static android.provider.Telephony.Intents.SPN_STRINGS_UPDATED_ACTION;
-import com.android.internal.telephony.SimCard;
+import com.android.internal.telephony.IccCard;
 import com.android.internal.telephony.TelephonyIntents;
 import android.util.Log;
 import com.android.internal.R;
@@ -61,7 +61,7 @@
 
     private final Context mContext;
 
-    private SimCard.State mSimState = SimCard.State.READY;
+    private IccCard.State mSimState = IccCard.State.READY;
     private boolean mInPortrait;
     private boolean mKeyboardOpen;
 
@@ -94,38 +94,39 @@
 
 
     /**
-     * When we receive a {@link com.android.internal.telephony.TelephonyIntents#ACTION_SIM_STATE_CHANGED} broadcast, and
-     * then pass a result via our handler to {@link KeyguardUpdateMonitor#handleSimStateChange},
+     * When we receive a 
+     * {@link com.android.internal.telephony.TelephonyIntents#ACTION_SIM_STATE_CHANGED} broadcast, 
+     * and then pass a result via our handler to {@link KeyguardUpdateMonitor#handleSimStateChange},
      * we need a single object to pass to the handler.  This class helps decode
      * the intent and provide a {@link SimCard.State} result. 
      */
     private static class SimArgs {
 
-        public final SimCard.State simState;
+        public final IccCard.State simState;
 
         private SimArgs(Intent intent) {
             if (!TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) {
                 throw new IllegalArgumentException("only handles intent ACTION_SIM_STATE_CHANGED");
             }
-            String stateExtra = intent.getStringExtra(SimCard.INTENT_KEY_SIM_STATE);
-            if (SimCard.INTENT_VALUE_SIM_ABSENT.equals(stateExtra)) {
-                this.simState = SimCard.State.ABSENT;
-            } else if (SimCard.INTENT_VALUE_SIM_READY.equals(stateExtra)) {
-                this.simState = SimCard.State.READY;
-            } else if (SimCard.INTENT_VALUE_SIM_LOCKED.equals(stateExtra)) {
+            String stateExtra = intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE);
+            if (IccCard.INTENT_VALUE_ICC_ABSENT.equals(stateExtra)) {
+                this.simState = IccCard.State.ABSENT;
+            } else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) {
+                this.simState = IccCard.State.READY;
+            } else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) {
                 final String lockedReason = intent
-                        .getStringExtra(SimCard.INTENT_KEY_LOCKED_REASON);
-                if (SimCard.INTENT_VALUE_LOCKED_ON_PIN.equals(lockedReason)) {
-                    this.simState = SimCard.State.PIN_REQUIRED;
-                } else if (SimCard.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) {
-                    this.simState = SimCard.State.PUK_REQUIRED;
+                        .getStringExtra(IccCard.INTENT_KEY_LOCKED_REASON);
+                if (IccCard.INTENT_VALUE_LOCKED_ON_PIN.equals(lockedReason)) {
+                    this.simState = IccCard.State.PIN_REQUIRED;
+                } else if (IccCard.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) {
+                    this.simState = IccCard.State.PUK_REQUIRED;
                 } else {
-                    this.simState = SimCard.State.UNKNOWN;
+                    this.simState = IccCard.State.UNKNOWN;
                 }
-            } else if (SimCard.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) {
-                this.simState = SimCard.State.NETWORK_LOCKED;
+            } else if (IccCard.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) {
+                this.simState = IccCard.State.NETWORK_LOCKED;
             } else {
-                this.simState = SimCard.State.UNKNOWN;
+                this.simState = IccCard.State.UNKNOWN;
             }
         }
 
@@ -195,7 +196,7 @@
         mKeyboardOpen = queryKeyboardOpen();
 
         // take a guess to start
-        mSimState = SimCard.State.READY;
+        mSimState = IccCard.State.READY;
         mDevicePluggedIn = true;
         mBatteryLevel = 100;
 
@@ -317,14 +318,14 @@
      * Handle {@link #MSG_SIM_STATE_CHANGE}
      */
     private void handleSimStateChange(SimArgs simArgs) {
-        final SimCard.State state = simArgs.simState;
+        final IccCard.State state = simArgs.simState;
 
         if (DEBUG) {
             Log.d(TAG, "handleSimStateChange: intentValue = " + simArgs + " "
                     + "state resolved to " + state.toString());
         }
 
-        if (state != SimCard.State.UNKNOWN && state != mSimState) {
+        if (state != IccCard.State.UNKNOWN && state != mSimState) {
             mSimState = state;
             for (int i = 0; i < mSimStateCallbacks.size(); i++) {
                 mSimStateCallbacks.get(i).onSimStateChanged(state);
@@ -461,7 +462,7 @@
      * Callback to notify of sim state change.
      */
     interface SimStateCallback {
-        void onSimStateChanged(SimCard.State simState);
+        void onSimStateChanged(IccCard.State simState);
     }
 
     /**
@@ -489,7 +490,7 @@
         mSimStateCallbacks.add(callback);
     }
 
-    public SimCard.State getSimState() {
+    public IccCard.State getSimState() {
         return mSimState;
     }
 
@@ -499,7 +500,7 @@
      * broadcast from the telephony code.
      */
     public void reportSimPinUnlocked() {
-        mSimState = SimCard.State.READY;
+        mSimState = IccCard.State.READY;
     }
 
     public boolean isInPortrait() {
diff --git a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java
index 71acef9..99480e7 100644
--- a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -16,7 +16,7 @@
 
 package com.android.internal.policy.impl;
 
-import com.android.internal.telephony.SimCard;
+import com.android.internal.telephony.IccCard;
 import com.android.internal.widget.LockPatternUtils;
 
 import android.app.AlarmManager;
@@ -41,6 +41,7 @@
 import android.view.WindowManagerImpl;
 import android.view.WindowManagerPolicy;
 
+
 /**
  * Mediates requests related to the keyguard.  This includes queries about the
  * state of the keyguard, power management events that effect whether the keyguard
@@ -89,7 +90,8 @@
 
     private final static String TAG = "KeyguardViewMediator";
 
-    private static final String DELAYED_KEYGUARD_ACTION = "com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD";
+    private static final String DELAYED_KEYGUARD_ACTION = 
+        "com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD";
 
     // used for handler messages
     private static final int TIMEOUT = 1;
@@ -301,7 +303,8 @@
                         0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
                 mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, when,
                         sender);
-                if (DEBUG) Log.d(TAG, "setting alarm to turn off keyguard, seq = " + mDelayedShowingSequence);
+                if (DEBUG) Log.d(TAG, "setting alarm to turn off keyguard, seq = " 
+                                 + mDelayedShowingSequence);
             } else {
                 doKeyguard();
             }
@@ -461,8 +464,8 @@
             
             // if the setup wizard hasn't run yet, don't show
             final boolean provisioned = mUpdateMonitor.isDeviceProvisioned();
-            final SimCard.State state = mUpdateMonitor.getSimState();
-            final boolean lockedOrMissing = state.isPinLocked() || (state == SimCard.State.ABSENT);
+            final IccCard.State state = mUpdateMonitor.getSimState();
+            final boolean lockedOrMissing = state.isPinLocked() || (state == IccCard.State.ABSENT);
             if (!lockedOrMissing && !provisioned) {
                 if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned"
                         + " and the sim is not locked or missing");
@@ -576,7 +579,7 @@
     }
 
     /** {@inheritDoc} */
-    public void onSimStateChanged(SimCard.State simState) {
+    public void onSimStateChanged(IccCard.State simState) {
         if (DEBUG) Log.d(TAG, "onSimStateChanged: " + simState);
 
         switch (simState) {
@@ -585,7 +588,7 @@
                 // gone through setup wizard
                 if (!mUpdateMonitor.isDeviceProvisioned()) {
                     if (!isShowing()) {
-                        if (DEBUG) Log.d(TAG, "INTENT_VALUE_SIM_ABSENT and keygaurd isn't showing, we need "
+                        if (DEBUG) Log.d(TAG, "INTENT_VALUE_ICC_ABSENT and keygaurd isn't showing, we need "
                              + "to show the keyguard since the device isn't provisioned yet.");
                         doKeyguard();
                     } else {
@@ -596,7 +599,7 @@
             case PIN_REQUIRED:
             case PUK_REQUIRED:
                 if (!isShowing()) {
-                    if (DEBUG) Log.d(TAG, "INTENT_VALUE_SIM_LOCKED and keygaurd isn't showing, we need "
+                    if (DEBUG) Log.d(TAG, "INTENT_VALUE_ICC_LOCKED and keygaurd isn't showing, we need "
                             + "to show the keyguard so the user can enter their sim pin");
                     doKeyguard();
                 } else {
@@ -759,10 +762,8 @@
      */
     private Handler mHandler = new Handler() {
         @Override
-        public void handleMessage(Message msg)
-        {
-            switch (msg.what)
-            {
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
                 case TIMEOUT:
                     handleTimeout(msg.arg1);
                     return ;
@@ -947,3 +948,5 @@
         }
     }
 }
+
+
diff --git a/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java
index e8fb7fd..12e735a 100644
--- a/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -21,7 +21,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.os.SystemProperties;
-import com.android.internal.telephony.SimCard;
+import com.android.internal.telephony.IccCard;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.KeyEvent;
@@ -132,7 +132,7 @@
     private boolean stuckOnLockScreenBecauseSimMissing() {
         return mRequiresSim
                 && (!mUpdateMonitor.isDeviceProvisioned())
-                && (mUpdateMonitor.getSimState() == SimCard.State.ABSENT);
+                && (mUpdateMonitor.getSimState() == IccCard.State.ABSENT);
     }
 
     /**
@@ -176,9 +176,9 @@
             }
 
             public void goToUnlockScreen() {
-                final SimCard.State simState = mUpdateMonitor.getSimState();
+                final IccCard.State simState = mUpdateMonitor.getSimState();
                 if (stuckOnLockScreenBecauseSimMissing()
-                         || (simState == SimCard.State.PUK_REQUIRED)){
+                         || (simState == IccCard.State.PUK_REQUIRED)){
                     // stuck on lock screen when sim missing or puk'd
                     return;
                 }
@@ -328,7 +328,7 @@
     public void wakeWhenReadyTq(int keyCode) {
         if (DEBUG) Log.d(TAG, "onWakeKey");
         if (keyCode == KeyEvent.KEYCODE_MENU && isSecure() && (mMode == Mode.LockScreen)
-                && (mUpdateMonitor.getSimState() != SimCard.State.PUK_REQUIRED)) {
+                && (mUpdateMonitor.getSimState() != IccCard.State.PUK_REQUIRED)) {
             if (DEBUG) Log.d(TAG, "switching screens to unlock screen because wake key was MENU");
             updateScreen(Mode.UnlockScreen);
             getCallback().pokeWakelock();
@@ -366,8 +366,8 @@
         if (unlockMode == UnlockMode.Pattern) {
             return mLockPatternUtils.isLockPatternEnabled();
         } else if (unlockMode == UnlockMode.SimPin) {
-            return mUpdateMonitor.getSimState() == SimCard.State.PIN_REQUIRED
-                        || mUpdateMonitor.getSimState() == SimCard.State.PUK_REQUIRED;
+            return mUpdateMonitor.getSimState() == IccCard.State.PIN_REQUIRED
+                        || mUpdateMonitor.getSimState() == IccCard.State.PUK_REQUIRED;
         } else if (unlockMode == UnlockMode.Account) {
             return true;
         } else {
@@ -485,8 +485,8 @@
      * the lock screen (lock or unlock).
      */
     private Mode getInitialMode() {
-        final SimCard.State simState = mUpdateMonitor.getSimState();
-        if (stuckOnLockScreenBecauseSimMissing() || (simState == SimCard.State.PUK_REQUIRED)) {
+        final IccCard.State simState = mUpdateMonitor.getSimState();
+        if (stuckOnLockScreenBecauseSimMissing() || (simState == IccCard.State.PUK_REQUIRED)) {
             return Mode.LockScreen;
         } else if (mUpdateMonitor.isKeyboardOpen() && isSecure()) {
             return Mode.UnlockScreen;
@@ -499,8 +499,8 @@
      * Given the current state of things, what should the unlock screen be?
      */
     private UnlockMode getUnlockMode() {
-        final SimCard.State simState = mUpdateMonitor.getSimState();
-        if (simState == SimCard.State.PIN_REQUIRED || simState == SimCard.State.PUK_REQUIRED) {
+        final IccCard.State simState = mUpdateMonitor.getSimState();
+        if (simState == IccCard.State.PIN_REQUIRED || simState == IccCard.State.PUK_REQUIRED) {
             return UnlockMode.SimPin;
         } else {
             return mLockPatternUtils.isPermanentlyLocked() ?
@@ -531,7 +531,8 @@
         int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
         String message = mContext.getString(
                 R.string.lockscreen_failed_attempts_almost_glogin,
-                LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,
+                LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET
+                - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,
                 LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,
                 timeoutInSeconds);
         final AlertDialog dialog = new AlertDialog.Builder(mContext)
@@ -600,3 +601,4 @@
         }
     }
 }
+
diff --git a/policy/com/android/internal/policy/impl/LockPatternKeyguardViewProperties.java b/policy/com/android/internal/policy/impl/LockPatternKeyguardViewProperties.java
index 4e0cf09..8a62cbd 100644
--- a/policy/com/android/internal/policy/impl/LockPatternKeyguardViewProperties.java
+++ b/policy/com/android/internal/policy/impl/LockPatternKeyguardViewProperties.java
@@ -19,7 +19,7 @@
 import com.android.internal.widget.LockPatternUtils;
 
 import android.content.Context;
-import com.android.internal.telephony.SimCard;
+import com.android.internal.telephony.IccCard;
 
 /**
  * Knows how to create a lock pattern keyguard view, and answer questions about
@@ -59,9 +59,9 @@
     }
 
     private boolean isSimPinSecure() {
-        final SimCard.State simState = mUpdateMonitor.getSimState();
-        return (simState == SimCard.State.PIN_REQUIRED || simState == SimCard.State.PUK_REQUIRED
-            || simState == SimCard.State.ABSENT);
+        final IccCard.State simState = mUpdateMonitor.getSimState();
+        return (simState == IccCard.State.PIN_REQUIRED || simState == IccCard.State.PUK_REQUIRED
+            || simState == IccCard.State.ABSENT);
     }
 
 }
diff --git a/policy/com/android/internal/policy/impl/LockScreen.java b/policy/com/android/internal/policy/impl/LockScreen.java
index 82a52f9..6d2b2a4 100644
--- a/policy/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/com/android/internal/policy/impl/LockScreen.java
@@ -29,7 +29,7 @@
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
-import com.android.internal.telephony.SimCard;
+import com.android.internal.telephony.IccCard;
 
 import java.util.Date;
 
@@ -193,7 +193,8 @@
                 final View view = mOnlyVisibleWhenSimNotOk[i];
                 view.setVisibility(View.GONE);
             }
-            refreshSimOkHeaders(mUpdateMonitor.getTelephonyPlmn(), mUpdateMonitor.getTelephonySpn());
+            refreshSimOkHeaders(mUpdateMonitor.getTelephonyPlmn(), 
+                                    mUpdateMonitor.getTelephonySpn());
             refreshAlarmDisplay();
             refreshBatteryDisplay();
         } else {
@@ -210,11 +211,11 @@
     }
 
     private void refreshSimBadInfo() {
-        final SimCard.State simState = mUpdateMonitor.getSimState();
-        if (simState == SimCard.State.PUK_REQUIRED) {
+        final IccCard.State simState = mUpdateMonitor.getSimState();
+        if (simState == IccCard.State.PUK_REQUIRED) {
             mHeaderSimBad1.setText(R.string.lockscreen_sim_puk_locked_message);
             mHeaderSimBad2.setText(R.string.lockscreen_sim_puk_locked_instructions);
-        } else if (simState == SimCard.State.ABSENT) {
+        } else if (simState == IccCard.State.ABSENT) {
             mHeaderSimBad1.setText(R.string.lockscreen_missing_sim_message);
             mHeaderSimBad2.setVisibility(View.GONE);
             //mHeaderSimBad2.setText(R.string.lockscreen_missing_sim_instructions);
@@ -226,7 +227,7 @@
 
     private void refreshUnlockIntructions() {
         if (mLockPatternUtils.isLockPatternEnabled()
-                || mUpdateMonitor.getSimState() == SimCard.State.PIN_REQUIRED) {
+                || mUpdateMonitor.getSimState() == IccCard.State.PIN_REQUIRED) {
             mLockInstructions.setText(R.string.lockscreen_instructions_when_pattern_enabled);
         } else {
             mLockInstructions.setText(R.string.lockscreen_instructions_when_pattern_disabled);
@@ -293,8 +294,8 @@
     }
 
     private void refreshSimOkHeaders(CharSequence plmn, CharSequence spn) {
-        final SimCard.State simState = mUpdateMonitor.getSimState();
-        if (simState == SimCard.State.READY) {
+        final IccCard.State simState = mUpdateMonitor.getSimState();
+        if (simState == IccCard.State.READY) {
             if (plmn != null) {
                 mHeaderSimOk1.setVisibility(View.VISIBLE);
                 mHeaderSimOk1.setText(plmn);
@@ -308,22 +309,22 @@
             } else {
                 mHeaderSimOk2.setVisibility(View.GONE);
             }
-        } else if (simState == SimCard.State.PIN_REQUIRED) {
+        } else if (simState == IccCard.State.PIN_REQUIRED) {
             mHeaderSimOk1.setVisibility(View.VISIBLE);
             mHeaderSimOk1.setText(R.string.lockscreen_sim_locked_message);
             mHeaderSimOk2.setVisibility(View.GONE);
-        } else if (simState == SimCard.State.ABSENT) {
+        } else if (simState == IccCard.State.ABSENT) {
             mHeaderSimOk1.setVisibility(View.VISIBLE);
             mHeaderSimOk1.setText(R.string.lockscreen_missing_sim_message_short);
             mHeaderSimOk2.setVisibility(View.GONE);
-        } else if (simState == SimCard.State.NETWORK_LOCKED) {
+        } else if (simState == IccCard.State.NETWORK_LOCKED) {
             mHeaderSimOk1.setVisibility(View.VISIBLE);
             mHeaderSimOk1.setText(R.string.lockscreen_network_locked_message);
             mHeaderSimOk2.setVisibility(View.GONE);
         }
     }
 
-    public void onSimStateChanged(SimCard.State simState) {
+    public void onSimStateChanged(IccCard.State simState) {
         mSimOk = isSimOk(simState);
         refreshViewsWRTSimOk();
     }
@@ -333,10 +334,10 @@
      *   a special screen with the emergency call button and keep them from
      *   doing anything else.
      */
-    private boolean isSimOk(SimCard.State simState) {
+    private boolean isSimOk(IccCard.State simState) {
         boolean missingAndNotProvisioned = (!mUpdateMonitor.isDeviceProvisioned()
-                && simState == SimCard.State.ABSENT);
-        return !(missingAndNotProvisioned || simState == SimCard.State.PUK_REQUIRED);
+                && simState == IccCard.State.ABSENT);
+        return !(missingAndNotProvisioned || simState == IccCard.State.PUK_REQUIRED);
     }
 
     public void onOrientationChange(boolean inPortrait) {
@@ -369,3 +370,4 @@
         mUpdateMonitor.removeCallback(this);
     }
 }
+
diff --git a/policy/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/com/android/internal/policy/impl/PhoneWindowManager.java
index 95dda57..10067bd 100644
--- a/policy/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -285,6 +285,7 @@
                         mFancyRotationAnimation);
             } catch (RemoteException e) {
                 // Ignore
+
             }
         }                                      
     }
@@ -1831,3 +1832,4 @@
         }
     }
 }
+