Update CarrierConfigLoader to use TM#getCarrierServicePackageName

The implementation for TelephonyManager#getCarrierServicePackageName
has been hightly optimized. Internally, the cached value is directly
returned instead of performing a heavy query from package manager.

Besides the performance improvement, the switch may largely reduce
the deadlock and IPC thread blocking due to the removal of IPC
call in most cases.

Bug: 217442920
Test: atest CarrierConfigLoaderTest
Change-Id: Id128e9df7a3d4460d789e5455ff6b5745c374183
Merged-In: Id128e9df7a3d4460d789e5455ff6b5745c374183
(cherry picked from commit f7c214a3118cad56f64e51fc28bb6569aae2ed65)
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 8a007b6..4f4b2a7 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -890,23 +890,16 @@
         return new CarrierIdentifier(mcc, mnc, spn, imsi, gid1, gid2, carrierId, specificCarrierId);
     }
 
-    /** Returns the package name of a priveleged carrier app, or null if there is none. */
+    /** Returns the package name of a privileged carrier app, or null if there is none. */
     @Nullable
     private String getCarrierPackageForPhoneId(int phoneId) {
-        List<String> carrierPackageNames;
         final long token = Binder.clearCallingIdentity();
         try {
-            carrierPackageNames = TelephonyManager.from(mContext)
-                .getCarrierPackageNamesForIntentAndPhone(
-                    new Intent(CarrierService.CARRIER_SERVICE_INTERFACE), phoneId);
+            return TelephonyManager.from(mContext)
+                    .getCarrierServicePackageNameForLogicalSlot(phoneId);
         } finally {
             Binder.restoreCallingIdentity(token);
         }
-        if (carrierPackageNames != null && carrierPackageNames.size() > 0) {
-            return carrierPackageNames.get(0);
-        } else {
-            return null;
-        }
     }
 
     private String getIccIdForPhoneId(int phoneId) {