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

Commit 669b1d6b authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Read SystemConfig on a worker thread"

parents 895fc78a b76e0fdf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public class SystemServerInitThreadPool {

    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() {
+10 −4
Original line number Diff line number Diff line
@@ -770,7 +770,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    /**
     * 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 @@ public class ActivityManagerService extends IActivityManager.Stub
        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 @@ public class ActivityManagerService extends IActivityManager.Stub
        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 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
        if (action != null) {
            if (mBackgroundLaunchBroadcasts.contains(action)) {
            if (getBackgroundLaunchBroadcasts().contains(action)) {
                if (DEBUG_BACKGROUND_CHECK) {
                    Slog.i(TAG, "Broadcast action " + action + " forcing include-background");
                }
+6 −5
Original line number Diff line number Diff line
@@ -455,6 +455,12 @@ public final class SystemServer {
     * 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.
@@ -665,11 +671,6 @@ public final class SystemServer {
        }

        try {
            Slog.i(TAG, "Reading configuration...");
            traceBeginAndSlog("ReadingSystemConfig");
            SystemConfig.getInstance();
            traceEnd();

            traceBeginAndSlog("StartKeyAttestationApplicationIdProviderService");
            ServiceManager.addService("sec_key_att_app_id_provider",
                    new KeyAttestationApplicationIdProviderService(context));