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

Skip to content
Commit 3b9744ea authored by Felipe Leme's avatar Felipe Leme
Browse files

Creates a mechanism to override UserManager.isHeadlessSystemUserMode().

By default, that mode is set by the OEM and is immutable, but
this change allows developers to change it on non-user builds by
calling `cmd user set-system-user-mode-emulation`.

Notice that changing the headless system user mode is not trivial;
besides the API implementation itself, it's also necessary to:

1. Check if it's possible (for example, user 0 cannot be locked)
2. Change the system user type in the persistent XML
3. Create a full user (when going full -> headless)
4. Re-install apps for system user (when going headless -> full)

(NOTE: steps 1 and 4 will be done in a follow-up CL -
commit 3a029b05d39018ba26f8b218bab968898362138e)

Bug: 226643927

Test: adb shell cmd user set-system-user-mode-emulation full # on automotive
Test: adb shell cmd user set-system-user-mode-emulation headless # on phone
Test: adb shell dumpsys user | grep -A 1 headless

Change-Id: I5ee7d41b5baf5c8a826a1c0b9e599955eb9ad23c
parent 12b74d24
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