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

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

Merge "Remove obsolete IMM#setRequestCursorUpdateDisplayIdCheck" into main

parents 7a6d153e 76c8b452
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -139,7 +139,6 @@ import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;

/**
@@ -4605,32 +4604,6 @@ public final class InputMethodManager {
        return IInputMethodManagerGlobalInvoker.getInputMethodWindowVisibleHeight(mClient);
    }

    /**
     * {@code true} means that
     * {@link RemoteInputConnectionImpl#requestCursorUpdatesInternal(int, int, int)} returns
     * {@code false} when the IME client and the IME run in different displays.
     */
    final AtomicBoolean mRequestCursorUpdateDisplayIdCheck = new AtomicBoolean(true);

    /**
     * Controls the display ID mismatch validation in
     * {@link RemoteInputConnectionImpl#requestCursorUpdatesInternal(int, int, int)}.
     *
     * <p>{@link #updateCursorAnchorInfo(View, CursorAnchorInfo)} is not guaranteed to work
     * correctly when the IME client and the IME run in different displays.  This is why
     * {@link RemoteInputConnectionImpl#requestCursorUpdatesInternal(int, int, int)} returns
     * {@code false} by default when the display ID does not match. This method allows special apps
     * to override this behavior when they are sure that it should work.</p>
     *
     * <p>By default the validation is enabled.</p>
     *
     * @param enabled {@code false} to disable the display ID validation.
     * @hide
     */
    public void setRequestCursorUpdateDisplayIdCheck(boolean enabled) {
        mRequestCursorUpdateDisplayIdCheck.set(enabled);
    }

    /**
     * Force switch to the last used input method and subtype. If the last input method didn't have
     * any subtypes, the framework will simply switch to the last input method with no subtype
+1 −2
Original line number Diff line number Diff line
@@ -1130,8 +1130,7 @@ final class RemoteInputConnectionImpl extends IRemoteInputConnection.Stub {
            Log.w(TAG, "requestCursorUpdates on inactive InputConnection");
            return false;
        }
        if (mParentInputMethodManager.mRequestCursorUpdateDisplayIdCheck.get()
                && mParentInputMethodManager.getDisplayId() != imeDisplayId) {
        if (mParentInputMethodManager.getDisplayId() != imeDisplayId) {
            // requestCursorUpdates() is not currently supported across displays.
            return false;
        }