Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73b0bbd1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Minor fixes handling START_USER_SWITCH_UI_MSG:"

parents 7b1d46ca e55688d4
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1630,7 +1630,7 @@ class UserController implements Handler.Callback {
            UserInfo currentUserInfo = getUserInfo(currentUserId);
            Pair<UserInfo, UserInfo> userNames = new Pair<>(currentUserInfo, targetUserInfo);
            mUiHandler.removeMessages(START_USER_SWITCH_UI_MSG);
            mUiHandler.sendMessage(mHandler.obtainMessage(
            mUiHandler.sendMessage(mUiHandler.obtainMessage(
                    START_USER_SWITCH_UI_MSG, userNames));
        } else {
            mHandler.removeMessages(START_USER_SWITCH_FG_MSG);
@@ -2887,14 +2887,19 @@ class UserController implements Handler.Callback {

        void showUserSwitchingDialog(UserInfo fromUser, UserInfo toUser,
                String switchingFromSystemUserMessage, String switchingToSystemUserMessage) {
            if (!mService.mContext.getPackageManager()
            if (mService.mContext.getPackageManager()
                    .hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
                // config_customUserSwitchUi is set to true on Automotive as CarSystemUI is
                // responsible to show the UI; OEMs should not change that, but if they do, we
                // should at least warn the user...
                Slog.w(TAG, "Showing user switch dialog on UserController, it could cause a race "
                        + "condition if it's shown by CarSystemUI as well");
            }
            final Dialog d = new UserSwitchingDialog(mService, mService.mContext, fromUser,
                    toUser, true /* above system */, switchingFromSystemUserMessage,
                    switchingToSystemUserMessage);
            d.show();
        }
        }

        void reportGlobalUsageEventLocked(int event) {
            synchronized (mService) {