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

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

Merge "Remove StartInputFlags.FIRST_WINDOW_FOCUS_GAIN"

parents c7e12ea1 847a7d97
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -439,7 +439,6 @@ public final class ViewRootImpl implements ViewParent,
    boolean mReportNextDraw;
    boolean mFullRedrawNeeded;
    boolean mNewSurfaceNeeded;
    boolean mHasHadWindowFocus;
    boolean mLastWasImTarget;
    boolean mForceNextWindowRelayout;
    CountDownLatch mWindowDrawCountDown;
@@ -2123,11 +2122,6 @@ public final class ViewRootImpl implements ViewParent,
                endDragResizing();
                destroyHardwareResources();
            }
            if (viewVisibility == View.GONE) {
                // After making a window gone, we will count it as being
                // shown for the first time the next time it gets focus.
                mHasHadWindowFocus = false;
            }
        }

        // Non-visible windows can't hold accessibility focus.
@@ -2823,8 +2817,7 @@ public final class ViewRootImpl implements ViewParent,
                if (imm != null && imTarget) {
                    imm.onPreWindowFocus(mView, hasWindowFocus);
                    imm.onPostWindowFocus(mView, mView.findFocus(),
                            mWindowAttributes.softInputMode,
                            !mHasHadWindowFocus, mWindowAttributes.flags);
                            mWindowAttributes.softInputMode, mWindowAttributes.flags);
                }
            }
        }
@@ -3017,8 +3010,7 @@ public final class ViewRootImpl implements ViewParent,
            if (hasWindowFocus) {
                if (imm != null && mLastWasImTarget && !isInLocalFocusMode()) {
                    imm.onPostWindowFocus(mView, mView.findFocus(),
                            mWindowAttributes.softInputMode,
                            !mHasHadWindowFocus, mWindowAttributes.flags);
                            mWindowAttributes.softInputMode, mWindowAttributes.flags);
                }
                // Clear the forward bit.  We can just do this directly, since
                // the window manager doesn't care about it.
@@ -3028,7 +3020,6 @@ public final class ViewRootImpl implements ViewParent,
                        .softInputMode &=
                        ~WindowManager.LayoutParams
                                .SOFT_INPUT_IS_FORWARD_NAVIGATION;
                mHasHadWindowFocus = true;

                // Refocusing a window that has a focused view should fire a
                // focus event for the view since the global focused view changed.
+3 −7
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ public final class InputMethodManager {
    boolean mActive = false;

    /**
     * {@code true} if next {@link #onPostWindowFocus(View, View, int, boolean, int)} needs to
     * {@code true} if next {@link #onPostWindowFocus(View, View, int, int)} needs to
     * restart input.
     */
    boolean mRestartOnNextWindowFocus = true;
@@ -1925,13 +1925,12 @@ public final class InputMethodManager {
     * @hide
     */
    public void onPostWindowFocus(View rootView, View focusedView,
            @SoftInputModeFlags int softInputMode, boolean first, int windowFlags) {
            @SoftInputModeFlags int softInputMode, int windowFlags) {
        boolean forceNewFocus = false;
        synchronized (mH) {
            if (DEBUG) Log.v(TAG, "onWindowFocus: " + focusedView
                    + " softInputMode=" + InputMethodDebug.softInputModeToString(softInputMode)
                    + " first=" + first + " flags=#"
                    + Integer.toHexString(windowFlags));
                    + " flags=#" + Integer.toHexString(windowFlags));
            if (mRestartOnNextWindowFocus) {
                if (DEBUG) Log.v(TAG, "Restarting due to mRestartOnNextWindowFocus");
                mRestartOnNextWindowFocus = false;
@@ -1947,9 +1946,6 @@ public final class InputMethodManager {
                startInputFlags |= StartInputFlags.IS_TEXT_EDITOR;
            }
        }
        if (first) {
            startInputFlags |= StartInputFlags.FIRST_WINDOW_FOCUS_GAIN;
        }

        if (checkFocusNoStartInput(forceNewFocus)) {
            // We need to restart input on the current focus view.  This
+0 −3
Original line number Diff line number Diff line
@@ -168,9 +168,6 @@ public final class InputMethodDebug {
        if ((startInputFlags & StartInputFlags.IS_TEXT_EDITOR) != 0) {
            joiner.add("IS_TEXT_EDITOR");
        }
        if ((startInputFlags & StartInputFlags.FIRST_WINDOW_FOCUS_GAIN) != 0) {
            joiner.add("FIRST_WINDOW_FOCUS_GAIN");
        }
        if ((startInputFlags & StartInputFlags.INITIAL_CONNECTION) != 0) {
            joiner.add("INITIAL_CONNECTION");
        }
+1 −7
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import java.lang.annotation.Retention;
@IntDef(flag = true, value = {
        StartInputFlags.VIEW_HAS_FOCUS,
        StartInputFlags.IS_TEXT_EDITOR,
        StartInputFlags.FIRST_WINDOW_FOCUS_GAIN,
        StartInputFlags.INITIAL_CONNECTION})
public @interface StartInputFlags {
    /**
@@ -43,14 +42,9 @@ public @interface StartInputFlags {
     */
    int IS_TEXT_EDITOR = 2;

    /**
     * This is the first time the window has gotten focus.
     */
    int FIRST_WINDOW_FOCUS_GAIN = 4;

    /**
     * An internal concept to distinguish "start" and "restart". This concept doesn't look well
     * documented hence we probably need to revisit this though.
     */
    int INITIAL_CONNECTION = 8;
    int INITIAL_CONNECTION = 4;
}