aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java')
-rw-r--r--java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
index e42de0b4c..01220a58a 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
@@ -105,8 +105,21 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
}
/**
- * Receives hover events when accessibility is turned on in SDK versions ICS
- * and higher.
+ * Intercepts touch events before dispatch when touch exploration is turned
+ * on in ICS and higher.
+ *
+ * @param event The motion event being dispatched.
+ * @return {@code true} if the event is handled
+ */
+ public boolean dispatchTouchEvent(MotionEvent event) {
+ // To avoid accidental key presses during touch exploration, always drop
+ // touch events generated by the user.
+ return false;
+ }
+
+ /**
+ * Receives hover events when touch exploration is turned on in SDK versions
+ * ICS and higher.
*
* @param event The hover event.
* @return {@code true} if the event is handled