Call onDismissed on dismiss even mUserSwitchingDialog is null.

In HSUM, mUserSwitchingDialog is not shown for the initial user switch
which is from system user to the main user. And for that switch,
completeUserSwitch step was not working properly to call user switch
complete events, like UserSwitchObserver.onUserSwitchComplete and
ACTION_USER_SWITCHED broadcasts, etc. This CL fixes that problem.

Bug: 279958141
Test: manual
Change-Id: I94cfd0229a128f37aa09cb1a00a425bbe7d92e1c
This commit is contained in:
Yasin Kilicdere
2023-05-17 18:37:26 +01:00
parent 36208fb4ba
commit 3b40f836e5

View File

@@ -3567,6 +3567,8 @@ class UserController implements Handler.Callback {
if (mUserSwitchingDialog != null) {
mUserSwitchingDialog.dismiss(onDismissed);
mUserSwitchingDialog = null;
} else if (onDismissed != null) {
onDismissed.run();
}
}
}