• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# User Switching
2
3Multiple users and the ability to switch between them is controlled by Settings -> System -> Multiple Users.
4
5## Entry Points
6
7### Quick Settings
8
9In the QS footer, an icon becomes available for users to tap on. The view and its onClick actions are handled by [MultiUserSwitchController][2]. Multiple visual implementations are currently in use; one for phones/foldables ([UserSwitchDialogController][6]) and one for tablets ([UserSwitcherFullscreenDialog][5]).
10
11### Bouncer
12
13May allow changing or adding new users directly from they bouncer. See [KeyguardBouncer][1]
14
15### Keyguard affordance
16
17[KeyguardQsUserSwitchController][4]
18
19## Components
20
21All visual implementations should derive their logic and use the adapter specified in:
22
23### [UserSwitcherController][3]
24
25* Contains the current list of all system users
26* Listens for relevant events and broadcasts to make sure this list stays up to date
27* Manages user switching and dialogs for exiting from guest users
28* Is settings aware regarding adding users from the lockscreen
29
30## Visual Components
31
32### [UserSwitcherFullscreenDialog][5]
33
34A fullscreen user switching activity, supporting add guest/user actions if configured.
35
36### [UserSwitchDialogController][6]
37
38Renders user switching as a dialog over the current surface, and supports add guest user/actions if configured.
39
40[1]: /frameworks/base/packages/SystemUI/docs/device-entry/bouncer.md
41[2]: /frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserController.java
42[3]: /frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
43[4]: /frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java
44[5]: /frameworks/base/packages/SystemUI/src/com/android/systemui/user/UserSwitcherFullscreenDialog.kt
45[6]: /frameworks/base/packages/SystemUI/src/com/android/systemui/qs/user/UserSwitchDialogController.kt
46