Revert "Change carrier name shown No Service to ECO"

This reverts commit b023773a18c37a8a50a6d18e552b1e440dff13e7.

Reason for revert: Not yet decided to release this at this stage

Change-Id: Ic0018cadcc228667a64f6f8c694bb6a04f00adc9

Bug: 130857483
Bug: 133201131
Bug: 132291669
diff --git a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java
index c26fdc2..2090748 100644
--- a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java
+++ b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java
@@ -324,25 +324,13 @@
         final CharSequence[] carrierNames = new CharSequence[numSubs];
         if (DEBUG) Log.d(TAG, "updateCarrierText(): " + numSubs);
 
-        boolean anySimEmergency = mKeyguardUpdateMonitor.isAnySimEmergencyAble();
         for (int i = 0; i < numSubs; i++) {
             int subId = subs.get(i).getSubscriptionId();
             carrierNames[i] = "";
             subsIds[i] = subId;
             subOrderBySlot[subs.get(i).getSimSlotIndex()] = i;
             IccCardConstants.State simState = mKeyguardUpdateMonitor.getSimState(subId);
-            ServiceState s = mKeyguardUpdateMonitor.getServiceState(subId);
             CharSequence carrierName = subs.get(i).getCarrierName();
-            // If this sub is showing No service but at least one slot currently supports emergency
-            // calls, it should replace it by Emergency calls only
-            if (s != null && s.getState() != ServiceState.STATE_IN_SERVICE && !s.isEmergencyOnly()
-                    && anySimEmergency) {
-                carrierName = getContext().getText(
-                        com.android.internal.R.string.emergency_calls_only);
-                if (DEBUG) {
-                    Log.d(TAG, "Subscription " + subId + "switched to ECO");
-                }
-            }
             CharSequence carrierTextForSimState = getCarrierTextForSimState(simState, carrierName);
             if (DEBUG) {
                 Log.d(TAG, "Handling (subId=" + subId + "): " + simState + " " + carrierName);
@@ -352,15 +340,16 @@
                 carrierNames[i] = carrierTextForSimState;
             }
             if (simState == IccCardConstants.State.READY) {
-                if (s != null && s.getDataRegState() == ServiceState.STATE_IN_SERVICE) {
+                ServiceState ss = mKeyguardUpdateMonitor.mServiceStates.get(subId);
+                if (ss != null && ss.getDataRegState() == ServiceState.STATE_IN_SERVICE) {
                     // hack for WFC (IWLAN) not turning off immediately once
                     // Wi-Fi is disassociated or disabled
-                    if (s.getRilDataRadioTechnology() != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
+                    if (ss.getRilDataRadioTechnology() != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
                             || (mWifiManager.isWifiEnabled()
                             && mWifiManager.getConnectionInfo() != null
                             && mWifiManager.getConnectionInfo().getBSSID() != null)) {
                         if (DEBUG) {
-                            Log.d(TAG, "SIM ready and in service: subId=" + subId + ", ss=" + s);
+                            Log.d(TAG, "SIM ready and in service: subId=" + subId + ", ss=" + ss);
                         }
                         anySimReadyAndInService = true;
                     }
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 446366b..6a4dbc8d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -195,12 +195,6 @@
     HashMap<Integer, SimData> mSimDatas = new HashMap<Integer, SimData>();
     HashMap<Integer, ServiceState> mServiceStates = new HashMap<Integer, ServiceState>();
 
-    /**
-     * Support up to 3 slots which is what's supported by {@link TelephonyManager#getPhoneCount}
-     */
-    private static final int SIM_SLOTS = 3;
-    private final ServiceState[] mServiceStatesBySlot = new ServiceState[SIM_SLOTS];
-
     private int mRingMode;
     private int mPhoneState;
     private boolean mKeyguardIsVisible;
@@ -332,7 +326,7 @@
                     handleAirplaneModeChanged();
                     break;
                 case MSG_SERVICE_STATE_CHANGE:
-                    handleServiceStateChange(msg.arg1, msg.arg2, (ServiceState) msg.obj);
+                    handleServiceStateChange(msg.arg1, (ServiceState) msg.obj);
                     break;
                 case MSG_SCREEN_TURNED_ON:
                     handleScreenTurnedOn();
@@ -1044,13 +1038,12 @@
                 ServiceState serviceState = ServiceState.newFromBundle(intent.getExtras());
                 int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
                         SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-                int slotId = intent.getIntExtra(PhoneConstants.SLOT_KEY, -1);
                 if (DEBUG) {
                     Log.v(TAG, "action " + action + " serviceState=" + serviceState + " subId="
                             + subId);
                 }
-                mHandler.obtainMessage(MSG_SERVICE_STATE_CHANGE, subId, slotId, serviceState)
-                        .sendToTarget();
+                mHandler.sendMessage(
+                        mHandler.obtainMessage(MSG_SERVICE_STATE_CHANGE, subId, 0, serviceState));
             } else if (DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED.equals(
                     action)) {
                 mHandler.sendEmptyMessage(MSG_DEVICE_POLICY_MANAGER_STATE_CHANGED);
@@ -2049,14 +2042,6 @@
      */
     @VisibleForTesting
     void handleServiceStateChange(int subId, ServiceState serviceState) {
-        handleServiceStateChange(subId, -1, serviceState);
-    }
-
-    /**
-     * Handle {@link #MSG_SERVICE_STATE_CHANGE}
-     */
-    @VisibleForTesting
-    void handleServiceStateChange(int subId, int slotId, ServiceState serviceState) {
         if (DEBUG) {
             Log.d(TAG,
                     "handleServiceStateChange(subId=" + subId + ", serviceState=" + serviceState);
@@ -2070,7 +2055,6 @@
         }
 
         mServiceStates.put(subId, serviceState);
-        if (slotId >= 0 && slotId < SIM_SLOTS) mServiceStatesBySlot[slotId] = serviceState;
 
         for (int j = 0; j < mCallbacks.size(); j++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
@@ -2296,21 +2280,6 @@
         return mServiceStates.get(subId);
     }
 
-    /**
-     * @return true iff at least one slot currently supports emergency calls
-     */
-    public boolean isAnySimEmergencyAble() {
-        for (int i = 0; i < SIM_SLOTS; i++) {
-            ServiceState s = mServiceStatesBySlot[i];
-            if (s != null) {
-                if (s.getState() == ServiceState.STATE_IN_SERVICE || s.isEmergencyOnly()) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
     public void clearBiometricRecognized() {
         mUserFingerprintAuthenticated.clear();
         mUserFaceAuthenticated.clear();