Multiple users and the ability to switch between them is controlled by Settings -> System -> Multiple Users.
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 (UserSwitcherFullscreenDialog).
May allow changing or adding new users directly from they bouncer. See KeyguardBouncer
KeyguardQsUserSwitchController
All visual implementations should derive their logic and use the adapter specified in:
A fullscreen user switching activity, supporting add guest/user actions if configured.
Renders user switching as a dialog over the current surface, and supports add guest user/actions if configured.