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
Loading
Please register or sign in to comment