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

Commit 69cf329c authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Register IME back callback on new dispatcher" into main

parents 1b1ff48f a3fc0f23
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -838,8 +838,14 @@ public class InputMethodService extends AbstractInputMethodService {
            // {@link #restartInput(InputConnection, EditorInfo)}.
            mImeDispatcher = params.imeDispatcher;
            if (mWindow != null) {
                mWindow.getOnBackInvokedDispatcher().setImeOnBackInvokedDispatcher(
                        params.imeDispatcher);
                mWindow.getOnBackInvokedDispatcher().setImeOnBackInvokedDispatcher(mImeDispatcher);
                if (mDecorViewVisible && mShowInputRequested) {
                    // Back callback is typically registered in {@link #showWindow()}, but it's
                    // possible for {@link #doStartInput()} to be called without
                    // {@link #showWindow()} so we also register here, after setting the new
                    // dispatcher.
                    registerDefaultOnBackInvokedCallback();
                }
            }
        }

@@ -3405,10 +3411,6 @@ public class InputMethodService extends AbstractInputMethodService {
                mInlineSuggestionSessionController.notifyOnStartInputView();
                onStartInputView(mInputEditorInfo, restarting);
                startExtractingText(true);
                // Back callback is typically registered in {@link #showWindow()}, but it's possible
                // for {@link #doStartInput()} to be called without {@link #showWindow()} so we also
                // register here.
                registerDefaultOnBackInvokedCallback();
            } else if (mCandidatesVisibility == View.VISIBLE) {
                if (DEBUG) Log.v(TAG, "CALL: onStartCandidatesView");
                mCandidatesViewStarted = true;