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

Commit 6ffda702 authored by Brandon Liu's avatar Brandon Liu Committed by Automerger Merge Worker
Browse files

Merge "Skip real action when onStartUser() called for the same user not on the...

Merge "Skip real action when onStartUser() called for the same user not on the first time" into main am: 0ebf8d8d am: 26281810 am: 92189104 am: de82f5dd

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



Change-Id: I51c245fc9a3ba0ac7c5471e59eee2abcfed88391
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 54f793a9 de82f5dd
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -261,6 +261,8 @@ public final class OverlayManagerService extends SystemService {

    private final OverlayActorEnforcer mActorEnforcer;

    private int mPrevStartedUserId = -1;

    public OverlayManagerService(@NonNull final Context context) {
        super(context);
        try {
@@ -338,6 +340,10 @@ public final class OverlayManagerService extends SystemService {
    }

    private void onStartUser(@UserIdInt int newUserId) {
        // Do nothing when start a user that is the same as the one started previously.
        if (newUserId == mPrevStartedUserId) {
            return;
        }
        try {
            traceBegin(TRACE_TAG_RRO, "OMS#onStartUser " + newUserId);
            // ensure overlays in the settings are up-to-date, and propagate
@@ -348,6 +354,7 @@ public final class OverlayManagerService extends SystemService {
        } finally {
            traceEnd(TRACE_TAG_RRO);
        }
        mPrevStartedUserId = newUserId;
    }

    private static String[] getDefaultOverlayPackages() {