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

Commit 1d70531b authored by Felipe Leme's avatar Felipe Leme
Browse files

Don't start first human user twice on headless-system mode.

It speeds up boot on automotive in about 25ms.

Bug: 128904478
Test: manual verification
Test: atest CtsVoiceInteractionTestCases CtsAssistTestCases # on walleye and automotive

Change-Id: I37cdca09b5280193a07ed9951f2e386ed3cd2299
parent bfd56df4
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -9126,7 +9126,16 @@ public class ActivityManagerService extends IActivityManager.Stub
                Integer.toString(currentUserId), currentUserId);
        mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_USER_FOREGROUND_START,
                Integer.toString(currentUserId), currentUserId);
        // On Automotive, at this point the system user has already been started and unlocked,
        // and some of the tasks we do here have already been done. So skip those in that case.
        // TODO(b/132262830): this workdound shouldn't be necessary once we move the
        // headless-user start logic to UserManager-land
        final boolean bootingSystemUser = currentUserId == UserHandle.USER_SYSTEM;
        if (bootingSystemUser) {
            mSystemServiceManager.startUser(t, currentUserId);
        }
        synchronized (this) {
            // Only start up encryption-aware persistent apps; once user is
@@ -9155,12 +9164,6 @@ public class ActivityManagerService extends IActivityManager.Stub
                t.traceEnd();
            }
            // On Automotive, at this point the system user has already been started and unlocked,
            // and some of the tasks we do here have already been done. So skip those in that case.
            // TODO(b/132262830): this workdound shouldn't be necessary once we move the
            // headless-user start logic to UserManager-land
            final boolean bootingSystemUser = currentUserId == UserHandle.USER_SYSTEM;
            if (bootingSystemUser) {
                t.traceBegin("startHomeOnAllDisplays");
                mAtmInternal.startHomeOnAllDisplays(currentUserId, "systemReady");