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

Skip to content
Commit e5a06ca6 authored by Adam Bookatz's avatar Adam Bookatz
Browse files

HsumBootUserInitializer creates MainUser earlier

Previously, on first boot, an HSUM device would unlock the system user,
then create the MainUser (if needed), and then switch to the boot user,
all at around the same time.

This cl reorders these events and spreads them out:
* first, early on (just prior to PHASE_SYSTEM_SERVICES_READY), the
  MainUser is created (if needed)

* later (after PHASE_THIRD_PARTY_APPS_CAN_START), the system user is
  unlocked

* then we promptly switch to the boot user. This needs to be after
  PHASE_THIRD_PARTY_APPS_CAN_START since special apps may designate a
  different boot user.

This will ensure that the MainUser can be retrieved much earlier on by
system services whose operations may depend on it.

Also, the structure of BootUserInitializer is renamed to better reflect
its role, and its structure is modified slightly to allow SystemServer
to use it more easily.

Bug: 262438904
Bug: 266098768
Test: flashed HSUM and confirmed that MainUser was created as needed
Test: atest FrameworksMockingServicesTests:com.android.server.pm.UserManagerServiceTest
Change-Id: Ic84b1be538234b2bfde3ae792c9a923ace55f24c
parent c0bcd9af
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment