diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-04-19 15:18:26 -0700 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2012-04-19 15:21:08 -0700 |
| commit | 00710e906bdafd58386ee7f81fa84addd218122f (patch) | |
| tree | f682c32f4975b41cb75c2b721f68443fe90cb0ca /core/java | |
| parent | 6ec0c6afafd9bad5e4c33578e9355997a280649c (diff) | |
| download | frameworks_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-x | core/java/android/view/InputDevice.java | 13 |
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 */ |
