From f64485029f221d15fd686368bd3f62789dadc490 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Fri, 11 Feb 2022 12:20:18 -0500 Subject: [PATCH] User switcher - Fix broken user addition Adding users from accounts other than the non-system user was not functional. Simply use the context to launch the CreateUserActivity in a new task stack. Also, address test failures where Dependency.get() was being used by other tests with the wrong context, creating failures in the user switcher tests. Remove this call from SystemUIDialog and update it everywhere. Fixes: 218989709 Fixes: 218824658 Test: atest KeyguardUserSwitcherAdapterTest UserDetailViewAdapterTest KeyguardSecurityContainerTest UserSwitcherControllerTest InternetDialogTest SystemUIDialogTest Change-Id: Iaceb3dd2add7d2372f9ec646610c8e147c516e63 --- .../res/layout/user_switcher_fullscreen.xml | 2 +- packages/SystemUI/res/values/styles.xml | 5 +- .../android/systemui/qs/tiles/CastTile.java | 2 +- .../systemui/qs/tiles/CellularTile.java | 10 +- .../qs/tiles/dialog/InternetDialog.java | 8 +- .../qs/tiles/dialog/InternetDialogFactory.kt | 6 +- .../statusbar/phone/SystemUIDialog.java | 8 +- .../policy/UserSwitcherController.java | 226 ++++++++---------- .../systemui/user/CreateUserActivity.java | 4 +- .../systemui/user/UserSwitcherActivity.kt | 8 +- .../qs/tiles/dialog/InternetDialogTest.java | 5 +- .../policy/UserSwitcherControllerTest.kt | 24 +- 12 files changed, 152 insertions(+), 156 deletions(-) diff --git a/packages/SystemUI/res/layout/user_switcher_fullscreen.xml b/packages/SystemUI/res/layout/user_switcher_fullscreen.xml index 1633e52e7a6c5..2d883bc1477fd 100644 --- a/packages/SystemUI/res/layout/user_switcher_fullscreen.xml +++ b/packages/SystemUI/res/layout/user_switcher_fullscreen.xml @@ -21,7 +21,7 @@ android:id="@+id/user_switcher_root" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginBottom="64dp" + android:layout_marginBottom="40dp" android:layout_marginEnd="60dp" android:layout_marginStart="60dp"> diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 5d252fdbd023f..b98354523e942 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -754,11 +754,10 @@ @drawable/ic_blank -