summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arthur Hung <arthurhung@google.com> 2022-01-17 01:50:16 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-01-17 01:50:16 +0000
commit35eef324464aee9d46301815ddad3d65578bf1a8 (patch)
tree412f139e60a0ac78ce686aac39b58fbc1d19fb13
parente1629a7f22077b51963bf4ea78eda4f2ab8f21c7 (diff)
parent902de4cc3a218a333999d63f32d10174d7a088ee (diff)
Merge "Adjust MotionEvent.FLAG_CANCELED flag to public"
-rw-r--r--core/api/current.txt1
-rw-r--r--core/java/android/view/MotionEvent.java13
2 files changed, 10 insertions, 4 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index bdf497f8ca64..e9749228b85c 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -49266,6 +49266,7 @@ package android.view {
field public static final int EDGE_LEFT = 4; // 0x4
field public static final int EDGE_RIGHT = 8; // 0x8
field public static final int EDGE_TOP = 1; // 0x1
+ field public static final int FLAG_CANCELED = 32; // 0x20
field public static final int FLAG_WINDOW_IS_OBSCURED = 1; // 0x1
field public static final int FLAG_WINDOW_IS_PARTIALLY_OBSCURED = 2; // 0x2
field public static final int INVALID_POINTER_ID = -1; // 0xffffffff
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index adb8b86493d5..0ef585478346 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -478,10 +478,15 @@ public final class MotionEvent extends InputEvent implements Parcelable {
public static final int FLAG_IS_GENERATED_GESTURE = 0x8;
/**
- * This flag associated with {@link #ACTION_POINTER_UP}, this indicates that the pointer
- * has been canceled. Typically this is used for palm event when the user has accidental
- * touches.
- * @hide
+ * This flag is only set for events with {@link #ACTION_POINTER_UP} and {@link #ACTION_CANCEL}.
+ * It indicates that the pointer going up was an unintentional user touch. When FLAG_CANCELED
+ * is set, the typical actions that occur in response for a pointer going up (such as click
+ * handlers, end of drawing) should be aborted. This flag is typically set when the user was
+ * accidentally touching the screen, such as by gripping the device, or placing the palm on the
+ * screen.
+ *
+ * @see #ACTION_POINTER_UP
+ * @see #ACTION_CANCEL
*/
public static final int FLAG_CANCELED = 0x20;