Reverting change which uses spnoverride to set ONS.
Sanket Padawe [Mon, 16 Feb 2015 20:18:29 +0000 (12:18 -0800)]
Bug: 19386079
Change-Id: I1417d55415be88a90c350fbe2533889630117503

src/java/com/android/internal/telephony/RIL.java
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
src/java/com/android/internal/telephony/uicc/SpnOverride.java

index 9fe9d7c..76dd32b 100644 (file)
@@ -64,7 +64,6 @@ import com.android.internal.telephony.uicc.IccCardStatus;
 import com.android.internal.telephony.uicc.IccIoResult;
 import com.android.internal.telephony.uicc.IccRefreshResponse;
 import com.android.internal.telephony.uicc.IccUtils;
-import com.android.internal.telephony.uicc.SpnOverride;
 import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
 import com.android.internal.telephony.cdma.CdmaInformationRecords;
 import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
@@ -3608,9 +3607,6 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         String strings[] = (String [])responseStrings(p);
         ArrayList<OperatorInfo> ret;
 
-        // FIXME: What is this really doing
-        SpnOverride spnOverride = new SpnOverride();
-
         if (strings.length % 4 != 0) {
             throw new RuntimeException(
                 "RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got "
@@ -3620,15 +3616,9 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         ret = new ArrayList<OperatorInfo>(strings.length / 4);
 
         for (int i = 0 ; i < strings.length ; i += 4) {
-            String strOperatorLong = null;
-            if (spnOverride.containsCarrier(strings[i+2])) {
-                strOperatorLong = spnOverride.getSpn(strings[i+2]);
-            } else {
-                strOperatorLong = strings[i+0];
-            }
             ret.add (
                 new OperatorInfo(
-                    strOperatorLong,
+                    strings[i+0],
                     strings[i+1],
                     strings[i+2],
                     strings[i+3]));
index bcb47be..1541c49 100755 (executable)
@@ -73,7 +73,6 @@ import com.android.internal.telephony.dataconnection.DcTrackerBase;
 import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
 import com.android.internal.telephony.uicc.IccRecords;
 import com.android.internal.telephony.uicc.SIMRecords;
-import com.android.internal.telephony.uicc.SpnOverride;
 import com.android.internal.telephony.uicc.UiccCard;
 import com.android.internal.telephony.uicc.UiccCardApplication;
 import com.android.internal.telephony.uicc.UiccController;
@@ -98,7 +97,6 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
     private GSMPhone mPhone;
     GsmCellLocation mCellLoc;
     GsmCellLocation mNewCellLoc;
-    SpnOverride mSpnOverride;
     int mPreferredNetworkType;
 
     private int mMaxDataCalls = 1;
@@ -226,7 +224,6 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
         mPhone = phone;
         mCellLoc = new GsmCellLocation();
         mNewCellLoc = new GsmCellLocation();
-        mSpnOverride = new SpnOverride();
 
         PowerManager powerManager =
                 (PowerManager)phone.getContext().getSystemService(Context.POWER_SERVICE);
@@ -816,16 +813,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                             log("EVENT_POLL_STATE_OPERATOR: use brandOverride=" + brandOverride);
                             mNewSS.setOperatorName(brandOverride, brandOverride, opNames[2]);
                         } else {
-                            String strOperatorLong = null;
-                            if (mSpnOverride.containsCarrier(opNames[2])) {
-                                log("EVENT_POLL_STATE_OPERATOR: use spnOverride");
-                                strOperatorLong = mSpnOverride.getSpn(opNames[2]);
-                            } else {
-                                log("EVENT_POLL_STATE_OPERATOR: use value from ril");
-                                strOperatorLong = opNames[0];
-                            }
-                            log("EVENT_POLL_STATE_OPERATOR: " + strOperatorLong);
-                            mNewSS.setOperatorName (strOperatorLong, opNames[1], opNames[2]);
+                            mNewSS.setOperatorName (opNames[0], opNames[1], opNames[2]);
                         }
                     }
                     break;
index 0b65cab..3a01af6 100644 (file)
@@ -39,16 +39,16 @@ public class SpnOverride {
     static final String PARTNER_SPN_OVERRIDE_PATH ="etc/spn-conf.xml";
     static final String OEM_SPN_OVERRIDE_PATH = "telephony/spn-conf.xml";
 
-    public SpnOverride () {
+    SpnOverride () {
         mCarrierSpnMap = new HashMap<String, String>();
         loadSpnOverrides();
     }
 
-    public boolean containsCarrier(String carrier) {
+    boolean containsCarrier(String carrier) {
         return mCarrierSpnMap.containsKey(carrier);
     }
 
-    public String getSpn(String carrier) {
+    String getSpn(String carrier) {
         return mCarrierSpnMap.get(carrier);
     }