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

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

OTA only adds Main if isMainUserPermanentAdmin

On OTA to Android U, we bestow upon one user the MainUser title. Not all
devices need to have a MainUser though, depnding on their configuration.
Nonetheless, we were previously always adding MainUser on OTA.

For HSUM devices that do NOT have config_isMainUserPermanentAdmin, we should
not be setting a MainUser on OTA, so we fix this here.

On non-HSUM, we continue to make user 0 the MainUser on OTA regardless
of configuration; non-HSUM user 0 being Main is just an invariant.

Moreover, we update the emulation logic to also take into account
config_isMainUserPermanentAdmin and the invariance.
The updated logic of emulation is:

non-HSUM -> emulate HSUM
Rule: in HSUM, we never have Sys be Main. We set a new main iff the config says to.
Scenarios:
* if main=Sys (usual phone case): Remove Main from system; if isMainUserPermanentAdmin(), switch/set a new Main.
* if no main (severly aberrant case): if isMainUserPermanentAdmin(), set a new Main.
* if main=other (aberrant case): leave as is

HSUM -> emulate non-HSUM
Rule: in non-HSUM, we always make Sys to be Main
Scenarios:
* if main=Sys (severely aberrant case): leave as is
* if no main (usual for Auto):  always make Sys the Main
* if main=other (usual for tablet): always switch Main to system

Test: manual OTA from T to U
Test: manual emulate different modes
Bug: 272295293
Change-Id: Id915203fe07b65cdd0e7e08df92fe93454be4f6f
parent 3521df06
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