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

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

Merge "Add new InputBindResult.ResultCode for no editor"

parents c437b8ec 2f731c55
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -139,6 +139,10 @@ public final class InputBindResult implements Parcelable {
         * @see com.android.server.wm.WindowManagerService#inputMethodClientHasFocus(IInputMethodClient)
         * @see com.android.server.wm.WindowManagerService#inputMethodClientHasFocus(IInputMethodClient)
         */
         */
        int ERROR_NOT_IME_TARGET_WINDOW = 11;
        int ERROR_NOT_IME_TARGET_WINDOW = 11;
        /**
         * Indicates that focused view in the current window is not an editor.
         */
        int ERROR_NO_EDITOR = 12;
    }
    }


    @ResultCode
    @ResultCode
@@ -258,6 +262,8 @@ public final class InputBindResult implements Parcelable {
                return "ERROR_NULL";
                return "ERROR_NULL";
            case ResultCode.ERROR_NO_IME:
            case ResultCode.ERROR_NO_IME:
                return "ERROR_NO_IME";
                return "ERROR_NO_IME";
            case ResultCode.ERROR_NO_EDITOR:
                return "ERROR_NO_EDITOR";
            case ResultCode.ERROR_INVALID_PACKAGE_NAME:
            case ResultCode.ERROR_INVALID_PACKAGE_NAME:
                return "ERROR_INVALID_PACKAGE_NAME";
                return "ERROR_INVALID_PACKAGE_NAME";
            case ResultCode.ERROR_SYSTEM_NOT_READY:
            case ResultCode.ERROR_SYSTEM_NOT_READY:
@@ -287,6 +293,10 @@ public final class InputBindResult implements Parcelable {
     * Predefined error object for {@link ResultCode#NO_IME}.
     * Predefined error object for {@link ResultCode#NO_IME}.
     */
     */
    public static final InputBindResult NO_IME = error(ResultCode.ERROR_NO_IME);
    public static final InputBindResult NO_IME = error(ResultCode.ERROR_NO_IME);
    /**
     * Predefined error object for {@link ResultCode#NO_EDITOR}.
     */
    public static final InputBindResult NO_EDITOR = error(ResultCode.ERROR_NO_EDITOR);
    /**
    /**
     * Predefined error object for {@link ResultCode#ERROR_INVALID_PACKAGE_NAME}.
     * Predefined error object for {@link ResultCode#ERROR_INVALID_PACKAGE_NAME}.
     */
     */
+13 −6
Original line number Original line Diff line number Diff line
@@ -2970,12 +2970,19 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                        break;
                        break;
                }
                }


                if (!didStart && attribute != null) {
                if (!didStart) {
                    if (attribute != null) {
                        if (!DebugFlags.FLAG_OPTIMIZE_START_INPUT.value()
                        if (!DebugFlags.FLAG_OPTIMIZE_START_INPUT.value()
                                || (controlFlags
                                || (controlFlags
                                & InputMethodManager.CONTROL_WINDOW_IS_TEXT_EDITOR) != 0) {
                                & InputMethodManager.CONTROL_WINDOW_IS_TEXT_EDITOR) != 0) {
                        res = startInputUncheckedLocked(cs, inputContext, missingMethods, attribute,
                            res = startInputUncheckedLocked(cs, inputContext, missingMethods,
                                    attribute,
                                    controlFlags, startInputReason);
                                    controlFlags, startInputReason);
                        } else {
                            res = InputBindResult.NO_EDITOR;
                        }
                    } else {
                        res = InputBindResult.NULL_EDITOR_INFO;
                    }
                    }
                }
                }
            }
            }