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

Commit aef9f7a6 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Define MotionEventFlag as an AIDL enum

Bug: 346613247
Test: presbumit
Flag: NONE no behavior change
Change-Id: I60c2d1c30d9e7af98245b53da147bc59cf518946
parent 289bec5c
Loading
Loading
Loading
Loading
+10 −18
Original line number Diff line number Diff line
@@ -16,15 +16,6 @@

package android.view;

import static android.os.IInputConstants.INPUT_EVENT_FLAG_CANCELED;
import static android.os.IInputConstants.MOTION_EVENT_FLAG_HOVER_EXIT_PENDING;
import static android.os.IInputConstants.INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT;
import static android.os.IInputConstants.MOTION_EVENT_FLAG_IS_GENERATED_GESTURE;
import static android.os.IInputConstants.MOTION_EVENT_FLAG_NO_FOCUS_CHANGE;
import static android.os.IInputConstants.INPUT_EVENT_FLAG_TAINTED;
import static android.os.IInputConstants.MOTION_EVENT_FLAG_TARGET_ACCESSIBILITY_FOCUS;
import static android.os.IInputConstants.MOTION_EVENT_FLAG_WINDOW_IS_OBSCURED;
import static android.os.IInputConstants.MOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED;
import static android.view.Display.DEFAULT_DISPLAY;

import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -38,6 +29,7 @@ import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.graphics.Matrix;
import android.os.Build;
import android.os.MotionEventFlag;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
@@ -476,7 +468,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * to drop the suspect touches or to take additional precautions to confirm the user's
     * actual intent.
     */
    public static final int FLAG_WINDOW_IS_OBSCURED = MOTION_EVENT_FLAG_WINDOW_IS_OBSCURED;
    public static final int FLAG_WINDOW_IS_OBSCURED = MotionEventFlag.WINDOW_IS_OBSCURED;

    /**
     * This flag indicates that the window that received this motion event is partly
@@ -493,7 +485,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * obstructed in areas other than the touched location.
     */
    public static final int FLAG_WINDOW_IS_PARTIALLY_OBSCURED =
            MOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED;
            MotionEventFlag.WINDOW_IS_PARTIALLY_OBSCURED;

    /**
     * This private flag is only set on {@link #ACTION_HOVER_MOVE} events and indicates that
@@ -501,7 +493,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * prevent generating redundant {@link #ACTION_HOVER_ENTER} events.
     * @hide
     */
    public static final int FLAG_HOVER_EXIT_PENDING = MOTION_EVENT_FLAG_HOVER_EXIT_PENDING;
    public static final int FLAG_HOVER_EXIT_PENDING = MotionEventFlag.HOVER_EXIT_PENDING;

    /**
     * This flag indicates that the event has been generated by a gesture generator. It
@@ -509,7 +501,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     *
     * @hide
     */
    public static final int FLAG_IS_GENERATED_GESTURE = MOTION_EVENT_FLAG_IS_GENERATED_GESTURE;
    public static final int FLAG_IS_GENERATED_GESTURE = MotionEventFlag.IS_GENERATED_GESTURE;

    /**
     * This flag is only set for events with {@link #ACTION_POINTER_UP} and {@link #ACTION_CANCEL}.
@@ -522,7 +514,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * @see #ACTION_POINTER_UP
     * @see #ACTION_CANCEL
     */
    public static final int FLAG_CANCELED = INPUT_EVENT_FLAG_CANCELED;
    public static final int FLAG_CANCELED = MotionEventFlag.CANCELED;

    /**
     * This flag indicates that the event will not cause a focus change if it is directed to an
@@ -531,7 +523,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * window into focus.
     * @hide
     */
    public static final int FLAG_NO_FOCUS_CHANGE = MOTION_EVENT_FLAG_NO_FOCUS_CHANGE;
    public static final int FLAG_NO_FOCUS_CHANGE = MotionEventFlag.NO_FOCUS_CHANGE;

    /**
     * This flag indicates that this event was modified by or generated from an accessibility
@@ -539,7 +531,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * @hide
     */
    @TestApi
    public static final int FLAG_IS_ACCESSIBILITY_EVENT = INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT;
    public static final int FLAG_IS_ACCESSIBILITY_EVENT = MotionEventFlag.IS_ACCESSIBILITY_EVENT;

    /**
     * Private flag that indicates when the system has detected that this motion event
@@ -550,7 +542,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * @see #isTainted
     * @see #setTainted
     */
    public static final int FLAG_TAINTED = INPUT_EVENT_FLAG_TAINTED;
    public static final int FLAG_TAINTED = MotionEventFlag.TAINTED;

    /**
     * Private flag indicating that this event was synthesized by the system and should be delivered
@@ -566,7 +558,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * @see #setTargetAccessibilityFocus(boolean)
     */
    public static final int FLAG_TARGET_ACCESSIBILITY_FOCUS =
            MOTION_EVENT_FLAG_TARGET_ACCESSIBILITY_FOCUS;
            MotionEventFlag.TARGET_ACCESSIBILITY_FOCUS;

    /** @hide */
    @IntDef(flag = true, prefix = { "FLAG_" }, value = {