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

Commit 6ee82749 authored by Felix Stern's avatar Felix Stern
Browse files

Set window visibility when user switch is triggered

Change-Id: I6c2f68b25e2c3f2040a59bc77e4de404da45c0d2
Test: open work profile chat with IME; go to Launcher and receive chat message; click on notification
Fix: 379482310
Flag: android.view.inputmethod.refactor_insets_controller
parent 060674a4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1209,8 +1209,14 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        // Hide soft input before user switch task since switch task may block main handler a while
        // and delayed the hideCurrentInputLocked().
        final var userData = getUserData(userId);
        if (Flags.refactorInsetsController()) {
            final var statsToken = createStatsTokenForFocusedClient(false /* show */,
                    SoftInputShowHideReason.HIDE_SWITCH_USER, userId);
            setImeVisibilityOnFocusedWindowClient(false, userData, statsToken);
        } else {
            hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow, 0 /* flags */,
                    SoftInputShowHideReason.HIDE_SWITCH_USER, userId);
        }
        final UserSwitchHandlerTask task = new UserSwitchHandlerTask(this, userId,
                clientToBeReset);
        mUserSwitchHandlerTask = task;