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

Commit 4a93fae0 authored by Nikolas Havrikov's avatar Nikolas Havrikov
Browse files

Add WINDOW_GAINED_FOCUS to IntDef annotation

This CL adds the missing WINDOW_GAINED_FOCUS annotation to the
StartInputFlags IntDef declaration to avoid compiler warnings such as
the one in IMMS#startInputOrWindowGainedFocusInternalLocked.

Also, this CL replaces decimals with bit-shift expressions as per AOSP
style guide.

Test: make
Bug: 205676419
Change-Id: I51fe293149d6f7fab5790d13764449d62cbdb668
parent c1eed6d9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ import java.lang.annotation.Retention;
@IntDef(flag = true, value = {
        StartInputFlags.VIEW_HAS_FOCUS,
        StartInputFlags.IS_TEXT_EDITOR,
        StartInputFlags.INITIAL_CONNECTION})
        StartInputFlags.INITIAL_CONNECTION,
        StartInputFlags.WINDOW_GAINED_FOCUS,
})
public @interface StartInputFlags {
    /**
     * There is a focused view in the focused window.
@@ -40,17 +42,17 @@ public @interface StartInputFlags {
    /**
     * The focused view is a text editor.
     */
    int IS_TEXT_EDITOR = 2;
    int IS_TEXT_EDITOR = 1 << 1;

    /**
     * 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 = 4;
    int INITIAL_CONNECTION = 1 << 2;

    /**
     * The start input happens when the window gained focus to call
     * {@code android.view.inputmethod.InputMethodManager#startInputAsyncOnWindowFocusGain}.
     */
    int WINDOW_GAINED_FOCUS = 8;
    int WINDOW_GAINED_FOCUS = 1 << 3;
}