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

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

Emulating HSUM toggles MainUser

When emulating a switch to/from HSUM:
* to HSUM -   if Main == 0, it gets moved to the oldest full user
              if Main != 0, it stays as is
              if Main doesn't exist, it continues to not exist
              if Main == 0 and there is no appropriate choice for new
                Main yet, don't set one in UMS, but let the
                BootUserInitializer handle it later
* from HSUM - if Main exists, always move Main to user 0
              if Main doesn't exist, it continues to not exist

Note that, in the future, we may want to relax the "from HSUM" case. But
for now, we ensure that in non-HSUM, user 0 is always the MainUser (if
any).

We also change it so that User 0 in HSUM is NOT set to be Main if there
is no correct viable choice. Doing so didnt really make sense, since a
headless user cannot be Main. It was so that Auto would at least have
*a* MainUser, but really, it could still wind up without one, so there's
no value in pretending otherwise.

Bug: 256624031
Test: Toggle on/off via cmd user set-system-user-mode-emulation
Change-Id: I3facf71e8b39c456f4bc663ff1de3234ba928524
parent 505d5141
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