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