From 89a3deb75e534a2ba632fc0dd71d0a26f45b7ddc Mon Sep 17 00:00:00 2001 From: Peter Kalauskas Date: Thu, 5 Aug 2021 19:20:17 -0700 Subject: [PATCH] Show indicator if guest creation is not allowed When guest creation is not allowed by the admin, show a badge on the icon. The guest icon will still appear in the list, but if clicked the user will see a dialog that says: "Blocked by your IT admin", "If you have questions, contact your IT admin" Test: With config_guestUserAutoCreated=true, set the device owner during SUW, then disable user creation in the admin app, then open QS user switcher from the lock screen. Bug: 195699593 Change-Id: I2cb404e8c3262b48efafcc73f341b5c45728ab76 --- .../systemui/statusbar/policy/UserSwitcherController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index 7548d1c435ed9..251ecc626387c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -343,8 +343,7 @@ public class UserSwitcherController implements Dumpable { true /* isGuest */, false /* isCurrent */, false /* isAddUser */, false /* isRestricted */, isSwitchToGuestEnabled); - // Don't call checkIfAddUserDisallowedByAdminOnly if - // config_guestUserAutoCreated=true. + checkIfAddUserDisallowedByAdminOnly(guestRecord); records.add(guestRecord); } else if (canCreateGuest) { guestRecord = new UserRecord(null /* info */, null /* picture */,