Skip to content
Commit 5d7f9056 authored by Anthony Hugh's avatar Anthony Hugh
Browse files

Expose findCurrentGuestUser() to system apps

This CL exposes UserManager.findCurrentGuestUser() to system apps.
When switching to Guest user, User Picker needs to know whether or not a
Guest already exists since the system limits only 1 to exist.

Currently, implementations handle this by manually filtering through
getUsers() and checking for isGuest().  Unfortunately, this also means
that callers need to understand the other flags on the UserInfo such as
guestToRemove.

UserManagerService already has code to do this filtering, so expose it
there so there is only one place to handle this logic.

In addition to the above, cleaned up Android Auto uses to utilize the
new API that's available.

Bug: 144379962
Test: Open SysUI User Picker and ensure I could select Guest.  Selecting
a persistent Guest correctly loaded the existing Guest.  Selecting Guest
when one didn't exist correctly created a new Guest.
Change-Id: If877e1c49a751d024c881d1457bea19eefeb1caf
parent 0d9dd2b0
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