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

Commit 43f5bf9b authored by Felipe Leme's avatar Felipe Leme
Browse files

Documented why am.systemReady() only sends user broadcasts for system user.

Bug: 128904478
Test: none

Change-Id: I265b8c553d30bd22c7498a6233594179a0b9c7cb
parent 8cfff7b8
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -9139,8 +9139,12 @@ public class ActivityManagerService extends IActivityManager.Stub
            mAtmInternal.showSystemReadyErrorDialogsIfNeeded();
            t.traceEnd();
            boolean isSystemUser = currentUserId == UserHandle.USER_SYSTEM;
            if (isSystemUser) {
            // Some systems - like automotive - will explicitly unlock system user then switch
            // to a secondary user. Hence, we don't want to send duplicate broadcasts for the
            // system user here.
            boolean sendSystemUserBroadcasts = currentUserId == UserHandle.USER_SYSTEM;
            if (sendSystemUserBroadcasts) {
                t.traceBegin("sendUserStartBroadcast");
                final int callingUid = Binder.getCallingUid();
                final int callingPid = Binder.getCallingPid();
@@ -9181,7 +9185,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            mAtmInternal.resumeTopActivities(false /* scheduleIdle */);
            t.traceEnd();
            if (isSystemUser) {
            if (sendSystemUserBroadcasts) {
                t.traceBegin("sendUserSwitchBroadcasts");
                mUserController.sendUserSwitchBroadcasts(-1, currentUserId);
                t.traceEnd();