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