Commit Graph

2 Commits

Author SHA1 Message Date
Oli Lan
f8a6722afc Add isMainUser system API.
This adds an API to determine if the context user is the designated
main user on the device. This user may have access to features which
are limited to a single user on the device.

In Android U, this will be the first user to go through setup.

On regular devices, this will be the system user, but on devices in
No Primary User / Headless System User Mode, it will be a different
user.

The isPrimaryUser System API is confusing because it actually always
returns the system user, even in headless mode. That API is deprecated
in this change.

On devices that are upgrading, if they are non-headless, the system user
will be the main user. If they are headless, the full user with the
earliest creation date will be given the flag.

Bug: 256624031
Test: atest UserManagerTest
Change-Id: Ib36f3b372f9bf33cbb097c4af63eb43515ac835b
2022-11-15 10:47:38 +00:00
Felipe Leme
00c7470ba7 Initial version of BootUserInitializer.
Test: manual verification changing ro.fw.mu.headless_system_user locally
Bug: 204091126

Change-Id: I721c126f68a45b448015d6caea4c8eef55d6d6b1
2021-11-03 20:11:08 +00:00