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