From e7a9ae8ba0fb7fc61960e3facd0c5534e9ffce1e Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 8 Mar 2013 15:19:19 -0800 Subject: Add touch navigation input source Bug: 8276741 Change-Id: I674b9804bf9ae76d694ae7073b54a7d43474a43c --- core/java/android/view/InputDevice.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'core/java/android/view/InputDevice.java') diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index c3dc76d81b99..dd523d23ea19 100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -62,7 +62,14 @@ public final class InputDevice implements Parcelable { * specify the desired interpretation for its input events. */ public static final int SOURCE_CLASS_MASK = 0x000000ff; - + + /** + * The input source has no class. + * + * It is up to the application to determine how to handle the device based on the device type. + */ + public static final int SOURCE_CLASS_NONE = 0x00000000; + /** * The input source has buttons or keys. * Examples: {@link #SOURCE_KEYBOARD}, {@link #SOURCE_DPAD}. @@ -201,6 +208,17 @@ public final class InputDevice implements Parcelable { */ public static final int SOURCE_TOUCHPAD = 0x00100000 | SOURCE_CLASS_POSITION; + /** + * The input source is a touch device whose motions should be interpreted as navigation events. + * + * For example, an upward swipe should be as an upward focus traversal in the same manner as + * pressing up on a D-Pad would be. Swipes to the left, right and down should be treated in a + * similar manner. + * + * @see #SOURCE_CLASS_NONE + */ + public static final int SOURCE_TOUCH_NAVIGATION = 0x00200000 | SOURCE_CLASS_NONE; + /** * The input source is a joystick. * (It may also be a {@link #SOURCE_GAMEPAD}). -- cgit v1.2.3