Skip to content
Commit 3d5d80ca authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Introduce config for auto-created guest users

Create a new frameworks config: config_guestUserAutoCreated.

If true,

 - Device should always have a guest user available.

 - Instead of showing "Add guest", the UI will show "Guest", and instead
   of "Remove guest", there will be an option to "Reset guest"

 - Guest user is always created on boot if it does not already exist

 - New guest user is created any time current guest user is removed

For now, these behaviors will be handled by System UI and Settings.

In addition, a few changes were made to System UI to simplify the code.
These changes may also affect devices running without the new config:

 - Move GuestResumeSessionReceiver.wipeGuestSession() to
   UserSwitcherController

 - New method: UserSwitcherController.createGuest()

 - Introduce dependency from KeyguardViewMediator to
   UserSwitcherController

 - Introduce dependency from GuestResumeSessionReceiver to
   UserSwitcherController

Bug: 188542158
Test: With config_guestUserAutoCreated=true, remove all guest users
      using adb (`adb shell cmd user list -v --all` to find the user
      ids, then remove each guest user with `adb shell pm remove-user
      <id>`), reboot device, check that there is a new guest on boot.
Test: With config_guestUserAutoCreated=true, reboot device when there is
      already a guest user, confirm that guest user was not wiped after
      reboot is completed.
Test: With config_guestUserAutoCreated=true, switch to guest user,
      select "Reset guest" from QS tile, select "Reset". Phone should
      switch back to last active user, and QS tile should now show
      "Guest" instead of "Add guest". Run `adb shell cmd user list -v
      --all` to confirm guest has a new user id.
Test: With config_guestUserAutoCreated=false, confirm that "Add guest"
      and "Remove guest" features remain unchanged
Change-Id: Ib1c8dd0a0796d95681167f51e12e3f4be21345af
Merged-In: Ib1c8dd0a0796d95681167f51e12e3f4be21345af
parent 255565b2
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