diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index e729d28..4ff7316 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -36,7 +36,6 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
-import android.os.Looper;
 import android.os.Message;
 import android.os.PersistableBundle;
 import android.os.Process;
@@ -56,7 +55,6 @@
 import android.util.LocalLog;
 import android.util.Log;
 
-import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.telephony.ICarrierConfigLoader;
 import com.android.internal.telephony.IccCardConstants;
 import com.android.internal.telephony.Phone;
@@ -203,10 +201,6 @@
     // 3. clearing config (e.g. due to sim removal)
     // 4. encountering bind or IPC error
     private class ConfigHandler extends Handler {
-        ConfigHandler(@NonNull Looper looper) {
-            super(looper);
-        }
-
         @Override
         public void handleMessage(Message msg) {
             final int phoneId = msg.arg1;
@@ -293,7 +287,7 @@
                         } else {
                             // Put a stub bundle in place so that the rest of the logic continues
                             // smoothly.
-                            mConfigFromDefaultApp[phoneId] = PersistableBundle.EMPTY;
+                            mConfigFromDefaultApp[phoneId] = new PersistableBundle();
                             // Send broadcast if bind fails.
                             notifySubscriptionInfoUpdater(phoneId);
                             // TODO: We *must* call unbindService even if bindService returns false.
@@ -378,7 +372,7 @@
                         broadcastConfigChangedIntent(phoneId);
                     }
                     // Put a stub bundle in place so that the rest of the logic continues smoothly.
-                    mConfigFromDefaultApp[phoneId] = PersistableBundle.EMPTY;
+                    mConfigFromDefaultApp[phoneId] = new PersistableBundle();
                     notifySubscriptionInfoUpdater(phoneId);
                     break;
                 }
@@ -425,7 +419,7 @@
                         } else {
                             // Put a stub bundle in place so that the rest of the logic continues
                             // smoothly.
-                            mConfigFromCarrierApp[phoneId] = PersistableBundle.EMPTY;
+                            mConfigFromCarrierApp[phoneId] = new PersistableBundle();
                             // Send broadcast if bind fails.
                             broadcastConfigChangedIntent(phoneId);
                             loge("Bind to carrier app: " + carrierPackageName + " fails");
@@ -510,7 +504,7 @@
                         broadcastConfigChangedIntent(phoneId);
                     }
                     // Put a stub bundle in place so that the rest of the logic continues smoothly.
-                    mConfigFromCarrierApp[phoneId] = PersistableBundle.EMPTY;
+                    mConfigFromCarrierApp[phoneId] = new PersistableBundle();
                     notifySubscriptionInfoUpdater(phoneId);
                     break;
                 }
@@ -672,13 +666,11 @@
      * Constructs a CarrierConfigLoader, registers it as a service, and registers a broadcast
      * receiver for relevant events.
      */
-    @VisibleForTesting
-    /* package */ CarrierConfigLoader(Context context,
-            SubscriptionInfoUpdater subscriptionInfoUpdater, @NonNull Looper looper) {
+    private CarrierConfigLoader(Context context) {
         mContext = context;
         mPlatformCarrierConfigPackage =
                 mContext.getString(R.string.platform_carrier_config_package);
-        mHandler = new ConfigHandler(looper);
+        mHandler = new ConfigHandler();
 
         IntentFilter bootFilter = new IntentFilter();
         bootFilter.addAction(Intent.ACTION_BOOT_COMPLETED);
@@ -698,7 +690,7 @@
         mConfigFromCarrierApp = new PersistableBundle[numPhones];
         mPersistentOverrideConfigs = new PersistableBundle[numPhones];
         mOverrideConfigs = new PersistableBundle[numPhones];
-        mNoSimConfig = PersistableBundle.EMPTY;
+        mNoSimConfig = new PersistableBundle();
         mServiceConnection = new CarrierServiceConnection[numPhones];
         mServiceBound = new boolean[numPhones];
         mHasSentConfigChange = new boolean[numPhones];
@@ -709,7 +701,7 @@
         TelephonyFrameworkInitializer
                 .getTelephonyServiceManager().getCarrierConfigServiceRegisterer().register(this);
         logd("CarrierConfigLoader has started");
-        mSubscriptionInfoUpdater = subscriptionInfoUpdater;
+        mSubscriptionInfoUpdater = PhoneFactory.getSubscriptionInfoUpdater();
         mHandler.sendEmptyMessage(EVENT_CHECK_SYSTEM_UPDATE);
     }
 
@@ -718,11 +710,11 @@
      *
      * This is only done once, at startup, from {@link com.android.phone.PhoneApp#onCreate}.
      */
-    /* package */ static CarrierConfigLoader init(Context context) {
+    /* package */
+    static CarrierConfigLoader init(Context context) {
         synchronized (CarrierConfigLoader.class) {
             if (sInstance == null) {
-                sInstance = new CarrierConfigLoader(context,
-                        PhoneFactory.getSubscriptionInfoUpdater(), Looper.myLooper());
+                sInstance = new CarrierConfigLoader(context);
             } else {
                 Log.wtf(LOG_TAG, "init() called multiple times!  sInstance = " + sInstance);
             }
@@ -730,8 +722,7 @@
         }
     }
 
-    @VisibleForTesting
-    /* package */ void clearConfigForPhone(int phoneId, boolean fetchNoSimConfig) {
+    private void clearConfigForPhone(int phoneId, boolean fetchNoSimConfig) {
         /* Ignore clear configuration request if device is being shutdown. */
         Phone phone = PhoneFactory.getPhone(phoneId);
         if (phone != null) {
@@ -768,7 +759,7 @@
         }
 
         if (configToSend == null) {
-            configToSend = PersistableBundle.EMPTY;
+            configToSend = new PersistableBundle();
         }
 
         // mOverrideConfigs is for testing. And it will override current configs.
@@ -853,8 +844,7 @@
         }
     }
 
-    @VisibleForTesting
-    /* package */ CarrierIdentifier getCarrierIdentifierForPhoneId(int phoneId) {
+    private CarrierIdentifier getCarrierIdentifierForPhoneId(int phoneId) {
         String mcc = "";
         String mnc = "";
         String imsi = "";
@@ -1010,14 +1000,12 @@
         }
     }
 
-    @VisibleForTesting
-    /* package */ void saveConfigToXml(String packageName, @NonNull String extraString, int phoneId,
+    private void saveConfigToXml(String packageName, @NonNull String extraString, int phoneId,
             CarrierIdentifier carrierId, PersistableBundle config) {
         saveConfigToXml(packageName, extraString, phoneId, carrierId, config, false);
     }
 
-    @VisibleForTesting
-    /* package */ void saveNoSimConfigToXml(String packageName, PersistableBundle config) {
+    private void saveNoSimConfigToXml(String packageName, PersistableBundle config) {
         saveConfigToXml(packageName, "", -1, null, config, true);
     }
 
@@ -1188,7 +1176,7 @@
             String callingFeatureId) {
         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mContext, subId, callingPackage,
                 callingFeatureId, "getCarrierConfig")) {
-            return PersistableBundle.EMPTY;
+            return new PersistableBundle();
         }
 
         int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1265,7 +1253,7 @@
     private void overrideConfig(@NonNull PersistableBundle[] currentOverrides, int phoneId,
             @Nullable PersistableBundle overrides) {
         if (overrides == null) {
-            currentOverrides[phoneId] = PersistableBundle.EMPTY;
+            currentOverrides[phoneId] = new PersistableBundle();
         } else if (currentOverrides[phoneId] == null) {
             currentOverrides[phoneId] = overrides;
         } else {
@@ -1327,31 +1315,6 @@
         return mPlatformCarrierConfigPackage;
     }
 
-    @VisibleForTesting
-    /* package */ Handler getHandler() {
-        return mHandler;
-    }
-
-    @VisibleForTesting
-    /* package */ PersistableBundle getConfigFromDefaultApp(int phoneId) {
-        return mConfigFromDefaultApp[phoneId];
-    }
-
-    @VisibleForTesting
-    /* package */ PersistableBundle getConfigFromCarrierApp(int phoneId) {
-        return mConfigFromCarrierApp[phoneId];
-    }
-
-    @VisibleForTesting
-     /* package */ PersistableBundle getNoSimConfig() {
-        return mNoSimConfig;
-    }
-
-    @VisibleForTesting
-    /* package */ PersistableBundle getOverrideConfig(int phoneId) {
-        return mOverrideConfigs[phoneId];
-    }
-
     private void unbindIfBound(Context context, CarrierServiceConnection conn,
             int phoneId) {
         if (mServiceBound[phoneId]) {
