diff --git a/services/core/java/com/android/server/SystemServerInitThreadPool.java b/services/core/java/com/android/server/SystemServerInitThreadPool.java
index d196850..5cc9bfd 100644
--- a/services/core/java/com/android/server/SystemServerInitThreadPool.java
+++ b/services/core/java/com/android/server/SystemServerInitThreadPool.java
@@ -44,7 +44,7 @@
 
     private static SystemServerInitThreadPool sInstance;
 
-    private ExecutorService mService = ConcurrentUtils.newFixedThreadPool(2,
+    private ExecutorService mService = ConcurrentUtils.newFixedThreadPool(4,
             "system-server-init-thread", Process.THREAD_PRIORITY_FOREGROUND);
 
     public static synchronized SystemServerInitThreadPool get() {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 7731228..c08bcef 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -770,7 +770,7 @@
     /**
      * Broadcast actions that will always be deliverable to unlaunched/background apps
      */
-    final ArraySet<String> mBackgroundLaunchBroadcasts;
+    ArraySet<String> mBackgroundLaunchBroadcasts;
 
     /**
      * All of the processes we currently have running organized by pid.
@@ -2615,12 +2615,11 @@
         mPermissionReviewRequired = mContext.getResources().getBoolean(
                 com.android.internal.R.bool.config_permissionReviewRequired);
 
-        mBackgroundLaunchBroadcasts = SystemConfig.getInstance().getAllowImplicitBroadcasts();
         if (DEBUG_BACKGROUND_CHECK) {
             Slog.d(TAG, "Enforcing O+ bg restrictions: " + mConstants.ENFORCE_BG_CHECK);
             StringBuilder sb = new StringBuilder(200);
             sb.append("  ");
-            for (String a : mBackgroundLaunchBroadcasts) {
+            for (String a : getBackgroundLaunchBroadcasts()) {
                 sb.append(' '); sb.append(a);
             }
             Slog.d(TAG, "Background implicit broadcasts:");
@@ -2784,6 +2783,13 @@
         mVoiceWakeLock.setReferenceCounted(false);
     }
 
+    private ArraySet<String> getBackgroundLaunchBroadcasts() {
+        if (mBackgroundLaunchBroadcasts == null) {
+            mBackgroundLaunchBroadcasts = SystemConfig.getInstance().getAllowImplicitBroadcasts();
+        }
+        return mBackgroundLaunchBroadcasts;
+    }
+
     @Override
     public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
             throws RemoteException {
@@ -18305,7 +18311,7 @@
         }
 
         if (action != null) {
-            if (mBackgroundLaunchBroadcasts.contains(action)) {
+            if (getBackgroundLaunchBroadcasts().contains(action)) {
                 if (DEBUG_BACKGROUND_CHECK) {
                     Slog.i(TAG, "Broadcast action " + action + " forcing include-background");
                 }
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index c3ef23b..df068bf 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -454,6 +454,12 @@
      * the other functions.
      */
     private void startBootstrapServices() {
+        Slog.i(TAG, "Reading configuration...");
+        final String TAG_SYSTEM_CONFIG = "ReadingSystemConfig";
+        traceBeginAndSlog(TAG_SYSTEM_CONFIG);
+        SystemServerInitThreadPool.get().submit(SystemConfig::getInstance, TAG_SYSTEM_CONFIG);
+        traceEnd();
+
         // Wait for installd to finish starting up so that it has a chance to
         // create critical directories such as /data/user with the appropriate
         // permissions.  We need this to complete before we initialize other services.
@@ -664,11 +670,6 @@
         }
 
         try {
-            Slog.i(TAG, "Reading configuration...");
-            traceBeginAndSlog("ReadingSystemConfig");
-            SystemConfig.getInstance();
-            traceEnd();
-
             traceBeginAndSlog("StartKeyAttestationApplicationIdProviderService");
             ServiceManager.addService("sec_key_att_app_id_provider",
                     new KeyAttestationApplicationIdProviderService(context));
