From 65a898d9ef63e321deb06d1ede835c182e7bcce1 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 28 Jul 2011 11:55:45 -0700 Subject: [PATCH] Simplifying accessibility code in keyboard's dispatchTouchEvent() Change-Id: Ie33cf93ee2d7eadad38ca170aa8ad988bb0ae9a9 --- .../accessibility/AccessibleKeyboardViewProxy.java | 9 --------- .../inputmethod/keyboard/LatinKeyboardBaseView.java | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java index 86a56308a..ae9809e56 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java @@ -118,15 +118,6 @@ public class AccessibleKeyboardViewProxy { return onHoverEventInternal(event, tracker); } - public boolean dispatchTouchEvent(MotionEvent event) { - // Since touch exploration translates hover double-tap to a regular - // single-tap, we're going to drop non-touch exploration events. - if (!AccessibilityUtils.getInstance().isTouchExplorationEvent(event)) - return true; - - return false; - } - /** * Handles touch exploration events when Accessibility is turned on. * diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java index cb1a2b782..b397ca757 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java @@ -567,9 +567,9 @@ public class LatinKeyboardBaseView extends KeyboardView implements PointerTracke @Override public boolean dispatchTouchEvent(MotionEvent event) { + // Drop non-hover touch events when touch exploration is enabled. if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) { - return AccessibleKeyboardViewProxy.getInstance().dispatchTouchEvent(event) - || super.dispatchTouchEvent(event); + return false; } return super.dispatchTouchEvent(event);