Merge "[Settings] Replace getSimCount() API"
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 753e924..68ad98c 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -457,10 +457,6 @@
         <item>1xRTT</item>
         <item>IS95B</item>
         <item>IS95A</item>
-        <item>GSM</item>
-        <item>TD_SCDMA</item>
-        <item>IWLAN</item>
-        <item>LTE_CA</item>
         <item>NR</item>
     </string-array>
 
@@ -498,14 +494,6 @@
         <!-- Do not translate. -->
         <item>4</item>
         <!-- Do not translate. -->
-        <item>16</item>
-        <!-- Do not translate. -->
-        <item>17</item>
-        <!-- Do not translate. -->
-        <item>18</item>
-        <!-- Do not translate. -->
-        <item>19</item>
-        <!-- Do not translate. -->
         <item>20</item>
     </string-array>
 
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index f10faa0..609a2d6 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -113,7 +113,7 @@
             NetworkPolicyManager policyManager = (NetworkPolicyManager)
                     mContext.getSystemService(Context.NETWORK_POLICY_SERVICE);
             if (policyManager != null) {
-                String subscriberId = telephonyManager.getSubscriberId(mSubId);
+                String subscriberId = telephonyManager.getSubscriberId();
                 policyManager.factoryReset(subscriberId);
             }
 
diff --git a/src/com/android/settings/SettingsDumpService.java b/src/com/android/settings/SettingsDumpService.java
index 501536a..487ccf5 100644
--- a/src/com/android/settings/SettingsDumpService.java
+++ b/src/com/android/settings/SettingsDumpService.java
@@ -107,8 +107,10 @@
         if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) {
             JSONArray array = new JSONArray();
             for (SubscriptionInfo info : manager.getAllSubscriptionInfoList()) {
+                telephonyManager = telephonyManager
+                        .createForSubscriptionId(info.getSubscriptionId());
                 NetworkTemplate mobileAll = NetworkTemplate.buildTemplateMobileAll(
-                        telephonyManager.getSubscriberId(info.getSubscriptionId()));
+                        telephonyManager.getSubscriberId());
                 final JSONObject usage = dumpDataUsage(mobileAll, controller);
                 usage.put("subId", info.getSubscriptionId());
                 array.put(usage);
diff --git a/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java b/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
index 2085cdf..a0c9859 100644
--- a/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
+++ b/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragment.java
@@ -149,7 +149,8 @@
         }
 
         final TextView operatorName = view.findViewById(R.id.operator_name_value);
-        final ServiceState serviceState = mTelephonyManager.getServiceStateForSubscriber(mSubId);
+        mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
+        final ServiceState serviceState = mTelephonyManager.getServiceState();
         operatorName.setText(serviceState.getOperatorAlphaLong());
 
         final TextView phoneTitle = view.findViewById(R.id.number_label);
diff --git a/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java b/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java
index 53b4f00..0d94928 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/RenameMobileNetworkDialogFragmentTest.java
@@ -86,7 +86,8 @@
 
         final ServiceState serviceState = mock(ServiceState.class);
         when(serviceState.getOperatorAlphaLong()).thenReturn("fake carrier name");
-        when(mTelephonyMgr.getServiceStateForSubscriber(mSubscriptionId)).thenReturn(serviceState);
+        when(mTelephonyMgr.createForSubscriptionId(anyInt())).thenReturn(mTelephonyMgr);
+        when(mTelephonyMgr.getServiceState()).thenReturn(serviceState);
     }
 
     @Test