diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index c9bd3710ca79b..6b6aa71d74c0a 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -845,6 +845,18 @@ android:visibleToInstantApps="true"> + + + diff --git a/packages/SystemUI/docs/user-switching.md b/packages/SystemUI/docs/user-switching.md new file mode 100644 index 0000000000000..dcf66b943f1dc --- /dev/null +++ b/packages/SystemUI/docs/user-switching.md @@ -0,0 +1,45 @@ +# 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][2]. Multiple visual implementations are currently in use; one for phones/foldables ([UserSwitchDialogController][6]) and one for tablets ([UserSwitcherActivity][5]). + +### Bouncer + +May allow changing or adding new users directly from they bouncer. See [KeyguardBouncer][1] + +### Keyguard affordance + +[KeyguardQsUserSwitchController][4] + +## Components + +All visual implementations should derive their logic and use the adapter specified in: + +### [UserSwitcherController][3] + +* 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][5] + +A fullscreen user switching activity, supporting add guest/user actions if configured. + +### [UserSwitchDialogController][6] + +Renders user switching as a dialog over the current surface, and supports add guest user/actions if configured. + +[1]: /frameworks/base/packages/SystemUI/docs/keyguard/bouncer.md +[2]: /frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserController.java +[3]: /frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +[4]: /frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java +[5]: /frameworks/base/packages/SystemUI/src/com/android/systemui/user/UserSwitcherActivity.kt +[6]: /frameworks/base/packages/SystemUI/src/com/android/systemui/qs/user/UserSwitchDialogController.kt diff --git a/packages/SystemUI/res-keyguard/values/dimens.xml b/packages/SystemUI/res-keyguard/values/dimens.xml index cbf4f83daeb54..dad4c19799afb 100644 --- a/packages/SystemUI/res-keyguard/values/dimens.xml +++ b/packages/SystemUI/res-keyguard/values/dimens.xml @@ -113,9 +113,17 @@ 28dp 12dp 248dp - 190dp 12dp 4dp 10dp 12dp + + + 16dp + 190dp + 222dp + + 8dp + 14sp + 12dp diff --git a/packages/SystemUI/res/drawable/user_switcher_icon_large.xml b/packages/SystemUI/res/drawable/user_switcher_icon_large.xml new file mode 100644 index 0000000000000..b78b2216c9f9f --- /dev/null +++ b/packages/SystemUI/res/drawable/user_switcher_icon_large.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout/user_switcher_fullscreen.xml b/packages/SystemUI/res/layout/user_switcher_fullscreen.xml new file mode 100644 index 0000000000000..7b95cf3cfa34b --- /dev/null +++ b/packages/SystemUI/res/layout/user_switcher_fullscreen.xml @@ -0,0 +1,70 @@ + + + + + + + + + + diff --git a/packages/SystemUI/res/layout/user_switcher_fullscreen_item.xml b/packages/SystemUI/res/layout/user_switcher_fullscreen_item.xml new file mode 100644 index 0000000000000..3319442a1a685 --- /dev/null +++ b/packages/SystemUI/res/layout/user_switcher_fullscreen_item.xml @@ -0,0 +1,33 @@ + + + + + diff --git a/packages/SystemUI/res/layout/user_switcher_fullscreen_popup_item.xml b/packages/SystemUI/res/layout/user_switcher_fullscreen_popup_item.xml new file mode 100644 index 0000000000000..8d02429150f0f --- /dev/null +++ b/packages/SystemUI/res/layout/user_switcher_fullscreen_popup_item.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 3ab569a19c0c1..15147786e557d 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -87,6 +87,7 @@ @color/GM2_grey_700 #77000000 + @android:color/system_neutral1_900 #E5FFFFFF diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 793647d2909d3..53aebda8a4b4e 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -2396,4 +2396,7 @@ Edit copied image Send to nearby device + + + Add diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 590cc9b4eb0a3..9448d3f342b97 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -771,6 +771,14 @@ @*android:color/primary_text_material_dark + +