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

Commit 922b0580 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Always look for display-specific IME." into main

parents 9fb2aa65 c49e6899
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -2436,13 +2436,11 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            return InputBindResult.NOT_IME_TARGET_WINDOW;
        }
        final int csDisplayId = cs.mSelfReportedDisplayId;
        final int oldDisplayIdToShowIme = mDisplayIdToShowIme;
        mDisplayIdToShowIme = mVisibilityStateComputer.computeImeDisplayId(winState, csDisplayId);

        // Potentially override the selected input method if the new display belongs to a virtual
        // device with a custom IME.
        String selectedMethodId = getSelectedMethodIdLocked();
        if (oldDisplayIdToShowIme != mDisplayIdToShowIme) {
        final String deviceMethodId = computeCurrentDeviceMethodIdLocked(selectedMethodId);
        if (deviceMethodId == null) {
            mVisibilityStateComputer.getImePolicy().setImeHiddenByDisplayPolicy(true);
@@ -2450,7 +2448,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            setInputMethodLocked(deviceMethodId, NOT_A_SUBTYPE_ID, mDeviceIdToShowIme);
            selectedMethodId = deviceMethodId;
        }
        }

        if (mVisibilityStateComputer.getImePolicy().isImeHiddenByDisplayPolicy()) {
            hideCurrentInputLocked(mCurFocusedWindow, null /* statsToken */, 0 /* flags */,
@@ -2549,10 +2546,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub

        final int oldDeviceId = mDeviceIdToShowIme;
        mDeviceIdToShowIme = mVdmInternal.getDeviceIdForDisplayId(mDisplayIdToShowIme);
        if (mDeviceIdToShowIme == oldDeviceId) {
        if (mDeviceIdToShowIme == DEVICE_ID_DEFAULT) {
            if (oldDeviceId == DEVICE_ID_DEFAULT) {
                return currentMethodId;
            }
        if (mDeviceIdToShowIme == DEVICE_ID_DEFAULT) {
            final String defaultDeviceMethodId = mSettings.getSelectedDefaultDeviceInputMethod();
            if (DEBUG) {
                Slog.v(TAG, "Restoring default device input method: " + defaultDeviceMethodId);