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

Commit 45d7f9c5 authored by Harry Cutts's avatar Harry Cutts Committed by Android (Google) Code Review
Browse files

Merge "Add MULTI_FINGER_SWIPE motion classification"

parents 0893c349 e2da4084
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -1491,11 +1491,23 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     */
    public static final int CLASSIFICATION_TWO_FINGER_SWIPE = 3;

    /**
     * Classification constant: multi-finger swipe.
     *
     * The current event stream represents the user swiping with three or more fingers on a
     * touchpad. Unlike two-finger swipes, these are only to be handled by the system UI, which is
     * why they have a separate constant from two-finger swipes.
     *
     * @see #getClassification
     * @hide
     */
    public static final int CLASSIFICATION_MULTI_FINGER_SWIPE = 4;

    /** @hide */
    @Retention(SOURCE)
    @IntDef(prefix = { "CLASSIFICATION" }, value = {
            CLASSIFICATION_NONE, CLASSIFICATION_AMBIGUOUS_GESTURE, CLASSIFICATION_DEEP_PRESS,
            CLASSIFICATION_TWO_FINGER_SWIPE})
            CLASSIFICATION_TWO_FINGER_SWIPE, CLASSIFICATION_MULTI_FINGER_SWIPE})
    public @interface Classification {};

    /**
@@ -3941,7 +3953,8 @@ public final class MotionEvent extends InputEvent implements Parcelable {
                return "DEEP_PRESS";
            case CLASSIFICATION_TWO_FINGER_SWIPE:
                return "TWO_FINGER_SWIPE";

            case CLASSIFICATION_MULTI_FINGER_SWIPE:
                return "MULTI_FINGER_SWIPE";
        }
        return "UNKNOWN";
    }
+2 −0
Original line number Diff line number Diff line
@@ -297,6 +297,8 @@ int32_t AMotionEvent_getClassification(const AInputEvent* motion_event) {
            return AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS;
        case android::MotionClassification::TWO_FINGER_SWIPE:
            return AMOTION_EVENT_CLASSIFICATION_TWO_FINGER_SWIPE;
        case android::MotionClassification::MULTI_FINGER_SWIPE:
            return AMOTION_EVENT_CLASSIFICATION_MULTI_FINGER_SWIPE;
    }
}