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