User Switching

Multiple users and the ability to switch between them is controlled by Settings -> System -> Multiple Users.

Entry Points

Quick Settings

In the QS footer, an icon becomes available for users to tap on. The view and its onClick actions are handled by MultiUserSwitchController. Multiple visual implementations are currently in use; one for phones/foldables (UserSwitchDialogController) and one for tablets (UserSwitcherActivity).

Bouncer

May allow changing or adding new users directly from they bouncer. See KeyguardBouncer

Keyguard affordance

KeyguardQsUserSwitchController

Components

All visual implementations should derive their logic and use the adapter specified in:

UserSwitcherController

  • Contains the current list of all system users
  • Listens for relevant events and broadcasts to make sure this list stays up to date
  • Manages user switching and dialogs for exiting from guest users
  • Is settings aware regarding adding users from the lockscreen

Visual Components

UserSwitcherActivity

A fullscreen user switching activity, supporting add guest/user actions if configured.

UserSwitchDialogController

Renders user switching as a dialog over the current surface, and supports add guest user/actions if configured.