Read SystemConfig on a worker thread
Also added lazy accessor for mBackgroundLaunchBroadcasts to give more
time for SystemConfig init to finish.
Test: manual
Bug: 34809967
Change-Id: Iaba0ac61714d94e72d571f33cd22d8700b89bb31
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));