summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-04-19 15:18:26 -0700
committerJeff Brown <jeffbrown@google.com>2012-04-19 15:21:08 -0700
commit00710e906bdafd58386ee7f81fa84addd218122f (patch)
treef682c32f4975b41cb75c2b721f68443fe90cb0ca /core/java
parent6ec0c6afafd9bad5e4c33578e9355997a280649c (diff)
downloadframeworks_base-00710e906bdafd58386ee7f81fa84addd218122f.zip
frameworks_base-00710e906bdafd58386ee7f81fa84addd218122f.tar.gz
frameworks_base-00710e906bdafd58386ee7f81fa84addd218122f.tar.bz2
Make InputDevice.SOURCE_STYLUS meaningful.
Bug: 5424551 Change-Id: I415cb1842422e050cc41b17f5a1f13b4fab17a44
Diffstat (limited to 'core/java')
-rwxr-xr-xcore/java/android/view/InputDevice.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java
index 4848a7a..85f435c 100755
--- a/core/java/android/view/InputDevice.java
+++ b/core/java/android/view/InputDevice.java
@@ -167,6 +167,19 @@ public final class InputDevice implements Parcelable {
/**
* The input source is a stylus pointing device.
+ * <p>
+ * Note that this bit merely indicates that an input device is capable of obtaining
+ * input from a stylus. To determine whether a given touch event was produced
+ * by a stylus, examine the tool type returned by {@link MotionEvent#getToolType(int)}
+ * for each individual pointer.
+ * </p><p>
+ * A single touch event may multiple pointers with different tool types,
+ * such as an event that has one pointer with tool type
+ * {@link MotionEvent#TOOL_TYPE_FINGER} and another pointer with tool type
+ * {@link MotionEvent#TOOL_TYPE_STYLUS}. So it is important to examine
+ * the tool type of each pointer, regardless of the source reported
+ * by {@link MotionEvent#getSource()}.
+ * </p>
*
* @see #SOURCE_CLASS_POINTER
*/