From 7ae7d8305e988cfbdd5ba8447e92660412d266a9 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 4 Apr 2022 13:26:07 -0400 Subject: [PATCH] User switcher - Fix adding user as non-system user The shade would stay expanded when adding a user as a non-system user. Make sure the broadcast is sent as the current user in order to be processed correctly. Fixes: 219638055 Test: manual, as guest user attempt to add user multiple times Change-Id: Ie293514fa4f8792616f5a0d7892c9010a8496ed0 --- .../systemui/statusbar/policy/UserSwitcherController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 fe08fb0a9d4fa..217a6134fbdec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -1215,7 +1215,8 @@ public class UserSwitcherController implements Dumpable { } // Use broadcast instead of ShadeController, as this dialog may have started in // another process and normal dagger bindings are not available - mBroadcastSender.closeSystemDialogs(); + mBroadcastSender.sendBroadcastAsUser( + new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), UserHandle.CURRENT); getContext().startActivityAsUser( CreateUserActivity.createIntentForStart(getContext()), mUserTracker.getUserHandle());