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

Commit 90aa9462 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Merge WINDOW_FOCUS_GAIN_REPORT_WITH{,OUT}_CONNECTION again"

parents e49fea2d 62f93a5c
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@ import static android.view.inputmethod.InputMethodManagerProto.FULLSCREEN_MODE;
import static android.view.inputmethod.InputMethodManagerProto.SERVED_CONNECTING;

import static com.android.internal.inputmethod.StartInputReason.BOUND_TO_IMMS;
import static com.android.internal.inputmethod.StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION;
import static com.android.internal.inputmethod.StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION;

import android.Manifest;
import android.annotation.DisplayContext;
@@ -805,19 +803,13 @@ public final class InputMethodManager {
            synchronized (mH) {
                // For some reason we didn't do a startInput + windowFocusGain, so
                // we'll just do a window focus gain and call it a day.
                boolean nextFocusHasConnection = mServedView != null && mServedView == focusedView
                        && hasActiveInputConnectionInternal(focusedView);
                if (DEBUG) {
                    Log.v(TAG, "Reporting focus gain, without startInput"
                            + ", nextFocusIsServedView=" + nextFocusHasConnection);
                    Log.v(TAG, "Reporting focus gain, without startInput");
                }

                final int startInputReason = nextFocusHasConnection
                        ? WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION
                        : WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION;
                // ignore the result
                mServiceInvoker.startInputOrWindowGainedFocus(
                        startInputReason, mClient,
                        StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY, mClient,
                        focusedView.getWindowToken(), startInputFlags, softInputMode,
                        windowFlags,
                        null,
+2 −4
Original line number Diff line number Diff line
@@ -47,10 +47,8 @@ public final class InputMethodDebug {
                return "UNSPECIFIED";
            case StartInputReason.WINDOW_FOCUS_GAIN:
                return "WINDOW_FOCUS_GAIN";
            case StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION:
                return "WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION";
            case StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION:
                return "WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION";
            case StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY:
                return "WINDOW_FOCUS_GAIN_REPORT_ONLY";
            case StartInputReason.APP_CALLED_RESTART_INPUT_API:
                return "APP_CALLED_RESTART_INPUT_API";
            case StartInputReason.CHECK_FOCUS:
+5 −11
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@ import java.lang.annotation.Retention;
@IntDef(value = {
        StartInputReason.UNSPECIFIED,
        StartInputReason.WINDOW_FOCUS_GAIN,
        StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION,
        StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION,
        StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY,
        StartInputReason.APP_CALLED_RESTART_INPUT_API,
        StartInputReason.CHECK_FOCUS,
        StartInputReason.BOUND_TO_IMMS,
@@ -51,18 +50,13 @@ public @interface StartInputReason {
     * to (re)start a new connection.
     */
    int WINDOW_FOCUS_GAIN = 1;
    /**
     * {@link android.view.Window} gained focus and the focused view is same as current served
     * view and its input connection remains. {@link android.view.inputmethod.InputMethodManager}
     * just reports this window focus change event to sync IME input target for system.
     */
    int WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION = 2;
    /**
     * {@link android.view.Window} gained focus but there is no {@link android.view.View} that is
     * eligible to have IME focus. {@link android.view.inputmethod.InputMethodManager} just reports
     * this window focus change event for logging.
     * eligible to have IME focus, or the focused view is same as current served view and its
     * input connection remains. {@link android.view.inputmethod.InputMethodManager} just reports
     * this window focus change event to sync IME input target for system.
     */
    int WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION = 3;
    int WINDOW_FOCUS_GAIN_REPORT_ONLY = 2;
    /**
     * {@link android.view.inputmethod.InputMethodManager#restartInput(android.view.View)} is
     * either explicitly called by the application or indirectly called by some Framework class