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

Commit 7b799c1c authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Ensure wm components are only initialized for main sysui process"

parents 09c5ee9f cbc2c7db
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui;

import android.app.ActivityThread;
import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
@@ -85,8 +86,10 @@ public class SystemUIFactory {
    @VisibleForTesting
    public void init(Context context, boolean fromTest)
            throws ExecutionException, InterruptedException {
        // Only initialize components for the main system ui process running as the primary user
        final boolean initializeComponents = !fromTest
                && android.os.Process.myUserHandle().isSystem();
                && android.os.Process.myUserHandle().isSystem()
                && ActivityThread.currentProcessName().equals(ActivityThread.currentPackageName());
        mRootComponent = buildGlobalRootComponent(context);
        // Stand up WMComponent
        mWMComponent = mRootComponent.getWMComponentBuilder().build();