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

Commit 402dfa14 authored by Wilson Wu's avatar Wilson Wu Committed by Automerger Merge Worker
Browse files

Merge "Fix delayed hide soft input when switch user" into sc-dev am: 462d7a9a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13769361

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9e5d0076a21df3a5bf76e0506e4ddd2eba127f1b
parents 87c4e274 462d7a9a
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -1626,6 +1626,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            }
            mHandler.removeCallbacks(mUserSwitchHandlerTask);
        }
        // Hide soft input before user switch task since switch task may block main handler a while
        // and delayed the MSG_HIDE_SOFT_INPUT.
        hideCurrentInputLocked(
                mCurFocusedWindow, 0, null, SoftInputShowHideReason.HIDE_SWITCH_USER);
        final UserSwitchHandlerTask task = new UserSwitchHandlerTask(this, userId,
                clientToBeReset);
        mUserSwitchHandlerTask = task;
@@ -1751,11 +1755,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        final boolean initialUserSwitch = TextUtils.isEmpty(defaultImiId);
        mLastSystemLocales = mRes.getConfiguration().getLocales();

        // TODO: Is it really possible that switchUserLocked() happens before system ready?
        if (mSystemReady) {
            hideCurrentInputLocked(
                    mCurFocusedWindow, 0, null, SoftInputShowHideReason.HIDE_SWITCH_USER);

        // The mSystemReady flag is set during boot phase,
        // and user switch would not happen at that time.
        resetCurrentMethodAndClient(UnbindReason.SWITCH_USER);
        buildInputMethodListLocked(initialUserSwitch);
        if (TextUtils.isEmpty(mSettings.getSelectedInputMethod())) {
@@ -1764,7 +1765,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            resetDefaultImeLocked(mContext);
        }
        updateFromSettingsLocked(true);
        }

        if (initialUserSwitch) {
            InputMethodUtils.setNonSelectedSystemImesDisabledUntilUsed(mIPackageManager,