Merge "Remove extra padding above Access point names in Mobile network of Settings" into pi-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4d0e90e..213af8f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -283,10 +283,10 @@
     <string name="exception_error">Network or SIM card error.</string>
     <!-- Status message displayed in the "Call settings error" dialog when
          current SS request is modified to a different request by STK CC -->
-    <string name="stk_cc_ss_to_dial_error">SS request modified to DIAL request.</string>
-    <string name="stk_cc_ss_to_ussd_error">SS request modified to USSD request.</string>
-    <string name="stk_cc_ss_to_ss_error">SS request modified to new SS request.</string>
-    <string name="stk_cc_ss_to_dial_video_error">SS request modified to Video DIAL request.</string>
+    <string name="stk_cc_ss_to_dial_error">SS request changed to regular call</string>
+    <string name="stk_cc_ss_to_ussd_error">SS request changed to USSD request</string>
+    <string name="stk_cc_ss_to_ss_error">Changed to new SS request</string>
+    <string name="stk_cc_ss_to_dial_video_error">SS request changed to video call</string>
 
     <!-- Status message displayed in the "Call settings error" dialog when operation fails due to FDN
          [CHAR LIMIT=NONE] -->
diff --git a/src/com/android/phone/NetworkSelectListPreference.java b/src/com/android/phone/NetworkSelectListPreference.java
index 146c76e..a8f29c9 100644
--- a/src/com/android/phone/NetworkSelectListPreference.java
+++ b/src/com/android/phone/NetworkSelectListPreference.java
@@ -411,7 +411,7 @@
                 String networkTitle = getNetworkTitle(cellInfo);
                 if (!networkEntriesList.contains(networkTitle)) {
                     networkEntriesList.add(networkTitle);
-                    networkEntryValuesList.add(Integer.toString(networkEntriesList.size() + 1));
+                    networkEntryValuesList.add(getOperatorNumeric(cellInfo));
                 }
             }
             setEntries(networkEntriesList.toArray(new CharSequence[networkEntriesList.size()]));
@@ -510,6 +510,16 @@
     }
 
     /**
+     * Returns the operator numeric (MCCMNC) obtained in the manual search.
+     *
+     * @param cellInfo contains the information of the network.
+     * @return MCCMNC string.
+     */
+    private String getOperatorNumeric(CellInfo cellInfo) {
+        return getOperatorInfoFromCellInfo(cellInfo).getOperatorNumeric();
+    }
+
+    /**
      * Wrap a cell info into an operator info.
      */
     private OperatorInfo getOperatorInfoFromCellInfo(CellInfo cellInfo) {
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 3fe908d..a13cd11 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1611,7 +1611,6 @@
 
     @Override
     public boolean isDataConnectivityPossible(int subId) {
-        enforceReadPrivilegedPermission();
         final Phone phone = getPhone(subId);
         if (phone != null) {
             return phone.isDataAllowed();
@@ -1906,18 +1905,12 @@
 
     @Override
     public int getActivePhoneTypeForSlot(int slotIndex) {
-        enforceReadPrivilegedPermission();
-        return getPhoneTypeForSlot(slotIndex);
-    }
-
-    @Override
-    public int getVoiceCapableActivePhoneTypeForSlot(int slotIndex) {
-        // Check if the device is voice-capable
-        if (!mApp.getResources()
-                .getBoolean(com.android.internal.R.bool.config_voice_capable)) {
-            return TelephonyManager.PHONE_TYPE_NONE;
+        final Phone phone = PhoneFactory.getPhone(slotIndex);
+        if (phone == null) {
+            return PhoneConstants.PHONE_TYPE_NONE;
+        } else {
+            return phone.getPhoneType();
         }
-        return getPhoneTypeForSlot(slotIndex);
     }
 
     /**
@@ -2022,7 +2015,6 @@
      * Returns true if CDMA provisioning needs to run.
      */
     public boolean needsOtaServiceProvisioning() {
-        enforceReadPrivilegedPermission();
         return mPhone.needsOtaServiceProvisioning();
     }
 
@@ -3052,7 +3044,6 @@
 
     @Override
     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
-        enforceReadPrivilegedPermission();
         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
             loge("phoneId " + phoneId + " is not valid.");
             return null;
@@ -3327,7 +3318,10 @@
 
     @Override
     public boolean isVideoCallingEnabled(String callingPackage) {
-        enforceReadPrivilegedPermission();
+        if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+                mApp, mPhone.getSubId(), callingPackage, "isVideoCallingEnabled")) {
+            return false;
+        }
 
         // Check the user preference and the  system-level IMS setting. Even if the user has
         // enabled video calling, if IMS is disabled we aren't able to support video calling.
@@ -4183,17 +4177,4 @@
                         DEFAULT_NETWORK_MODE_PROPERTY_NAME,
                         String.valueOf(Phone.PREFERRED_NT_MODE)));
     }
-
-    /**
-     * Util function that returns the phone type.
-     * @param slotIndex - slot to query.
-     */
-    private int getPhoneTypeForSlot(int slotIndex) {
-        final Phone phone = PhoneFactory.getPhone(slotIndex);
-        if (phone == null) {
-            return PhoneConstants.PHONE_TYPE_NONE;
-        } else {
-            return phone.getPhoneType();
-        }
-    }
 }