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

Commit 74e2556b authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Android (Google) Code Review
Browse files

Merge "InputDevice: Add IntDef annotation for input device source" into main

parents bcd8e5e3 f5134e84
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public final class InputDevice implements Parcelable {
    private final InputDeviceIdentifier mIdentifier;
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    private final boolean mIsExternal;
    @Source
    private final int mSources;
    private final int mKeyboardType;
    private final KeyCharacterMap mKeyCharacterMap;
@@ -359,6 +360,28 @@ public final class InputDevice implements Parcelable {
     */
    public static final int SOURCE_ANY = 0xffffff00;

    /** @hide */
    @IntDef(flag = true, prefix = { "SOURCE_" }, value = {
            SOURCE_UNKNOWN,
            SOURCE_KEYBOARD,
            SOURCE_DPAD,
            SOURCE_GAMEPAD,
            SOURCE_TOUCHSCREEN,
            SOURCE_MOUSE,
            SOURCE_STYLUS,
            SOURCE_BLUETOOTH_STYLUS,
            SOURCE_TRACKBALL,
            SOURCE_MOUSE_RELATIVE,
            SOURCE_TOUCHPAD,
            SOURCE_TOUCH_NAVIGATION,
            SOURCE_ROTARY_ENCODER,
            SOURCE_JOYSTICK,
            SOURCE_HDMI,
            SOURCE_SENSOR,
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface Source {}

    /**
     * Constant for retrieving the range of values for {@link MotionEvent#AXIS_X}.
     *