summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Harry Cutts <hcutts@google.com> 2023-01-05 18:36:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-01-05 18:36:02 +0000
commit45d7f9c5bee90bd82b9fe561a8b70b87806e7ab0 (patch)
tree8055e8f7708d1f3e0f111be80746e49e9901e8cc
parent0893c34919287f1063bc4038eadca24bf6b31c22 (diff)
parente2da4084a12368d022a217490af146bb9e3f5388 (diff)
Merge "Add MULTI_FINGER_SWIPE motion classification"
-rw-r--r--core/java/android/view/MotionEvent.java17
-rw-r--r--native/android/input.cpp2
2 files changed, 17 insertions, 2 deletions
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index 4fbb249c507f..1ff7ae662da0 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -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";
}
diff --git a/native/android/input.cpp b/native/android/input.cpp
index 812db0f1c507..5e5ebed78e61 100644
--- a/native/android/input.cpp
+++ b/native/android/input.cpp
@@ -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;
}
}