Skip to content
Commit 82606f8b authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

Wiring into UserSwitcherActivity.

UserSwitcherActivity refactor: CL 7/7

This CL wires in the new modern architecture implementation into the
activity that hosts the user switcher experience. It does so behind a
feature flag and keeps the old implementation unchanged.

Some care has been taken to do minimal changes to the code to keep it
from changing too much as part of this CL. At the same time, we needed
to make some changes to avoid side-effects and work that this activity
would otherwise do (for example, the adapter was moved behind a "lazy"
so it doesn't get instantiated in the new implementation as
instantiating it registers it for updates with UserSwitcherController
which can later cause exceptions if the adapter isn't properly hooked
up).

Bug: 243844359
Test: extensive manual testing, see the following lines for more.
1. No-harm testing for the old implementation. With the flag off, made
   sure that all the behaviours detailed below work the same after this
   CL as they worked before.
2. New implementation matches old implementation. User journeys
   exercised:
   a. Starting from the lock-screen or after unlocking and with and
   without Settings > System > Multiple Users > "Add users from lock
   screen" set - made sure that the "Add" button only appears when
   allowed
   b. Orientation changes. Made sure that the activity keeps its state
   and there are no crashes.
   c. Selecting a different user. Made sure that the system switches to
   the other user and that our activity exits as expected.
   d. Turning off the screen causes the activity to exit.
   e. Touching the cancel button causes our activity to exit.
   f. Clicking Add > Guest properly switches into the guest user and
   exits the activity. Returning to the activity properly shows the
   guest use as the current user with the name "Exit Guest" and tapping
   it properly goes back to the main user. Also, the menu options behind
   the "add" button are properly restricted to just "add user", "add
   child user", and "manage users"
   g. Add user, add child user, and manage users menu options all
   navigate the user to the correct destinations

Change-Id: I874eff89a8a3b81d8d5a632837ce2ccad92c82a4
parent b6508925
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