Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93538ad7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Start SystemConfig parsing before loading libandroid_servers" into main...

Merge "Start SystemConfig parsing before loading libandroid_servers" into main am: 5cf1e992 am: b310d164

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3479313



Change-Id: I6b6db0d1ec4150a99ae68bc3376d774d87b118d7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents eb9d9224 b310d164
Loading
Loading
Loading
Loading
+24 −8
Original line number Original line Diff line number Diff line
@@ -894,6 +894,17 @@ public final class SystemServer implements Dumpable {


            SystemServiceRegistry.sEnableServiceNotFoundWtf = true;
            SystemServiceRegistry.sEnableServiceNotFoundWtf = true;


            // Prepare the thread pool for init tasks that can be parallelized
            SystemServerInitThreadPool tp = SystemServerInitThreadPool.start();
            mDumper.addDumpable(tp);

            if (android.server.Flags.earlySystemConfigInit()) {
                // SystemConfig init is expensive, so enqueue the work as early as possible to allow
                // concurrent execution before it's needed (typically by ActivityManagerService).
                // As native library loading is also expensive, this is a good place to start.
                startSystemConfigInit(t);
            }

            // Initialize native services.
            // Initialize native services.
            System.loadLibrary("android_servers");
            System.loadLibrary("android_servers");


@@ -926,9 +937,6 @@ public final class SystemServer implements Dumpable {
            mDumper.addDumpable(mSystemServiceManager);
            mDumper.addDumpable(mSystemServiceManager);


            LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
            LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
            // Prepare the thread pool for init tasks that can be parallelized
            SystemServerInitThreadPool tp = SystemServerInitThreadPool.start();
            mDumper.addDumpable(tp);


            // Lazily load the pre-installed system font map in SystemServer only if we're not doing
            // Lazily load the pre-installed system font map in SystemServer only if we're not doing
            // the optimized font loading in the FontManagerService.
            // the optimized font loading in the FontManagerService.
@@ -1093,6 +1101,14 @@ public final class SystemServer implements Dumpable {
        }
        }
    }
    }


    private void startSystemConfigInit(TimingsTraceAndSlog t) {
        Slog.i(TAG, "Reading configuration...");
        final String tagSystemConfig = "ReadingSystemConfig";
        t.traceBegin(tagSystemConfig);
        SystemServerInitThreadPool.submit(SystemConfig::getInstance, tagSystemConfig);
        t.traceEnd();
    }

    private void createSystemContext() {
    private void createSystemContext() {
        ActivityThread activityThread = ActivityThread.systemMain();
        ActivityThread activityThread = ActivityThread.systemMain();
        mSystemContext = activityThread.getSystemContext();
        mSystemContext = activityThread.getSystemContext();
@@ -1131,11 +1147,11 @@ public final class SystemServer implements Dumpable {
        mDumper.addDumpable(watchdog);
        mDumper.addDumpable(watchdog);
        t.traceEnd();
        t.traceEnd();


        Slog.i(TAG, "Reading configuration...");
        // Legacy entry point for starting SystemConfig init, only needed if the early init flag is
        final String TAG_SYSTEM_CONFIG = "ReadingSystemConfig";
        // disabled and we haven't already triggered init before bootstrap services.
        t.traceBegin(TAG_SYSTEM_CONFIG);
        if (!android.server.Flags.earlySystemConfigInit()) {
        SystemServerInitThreadPool.submit(SystemConfig::getInstance, TAG_SYSTEM_CONFIG);
            startSystemConfigInit(t);
        t.traceEnd();
        }


        // Orchestrates some ProtoLogging functionality.
        // Orchestrates some ProtoLogging functionality.
        if (android.tracing.Flags.clientSideProtoLogging()) {
        if (android.tracing.Flags.clientSideProtoLogging()) {