From 586a15c3f0d44590a5162e0ab4c3c52511f13f26 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 26 Jul 2011 14:06:26 -0700 Subject: [PATCH] Fixed duplicate call to dispatchOnPopulateAccessibilityEvent() Bug: 5060194 Change-Id: I585ae52204a045fa3941e846b4f9bdd7d541bea6 --- .../AccessibleKeyboardViewProxy.java | 6 +++--- .../keyboard/LatinKeyboardBaseView.java | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java index 8ca834148..86a56308a 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java @@ -105,13 +105,13 @@ public class AccessibleKeyboardViewProxy { } /** - * Receives hover events when accessibility is turned on in API > 11. In - * earlier API levels, events are manually routed from onTouchEvent. + * Receives hover events when accessibility is turned on in SDK versions ICS + * and higher. * * @param event The hover event. * @return {@code true} if the event is handled */ - public boolean onHoverEvent(MotionEvent event, PointerTracker tracker) { + public boolean dispatchHoverEvent(MotionEvent event, PointerTracker tracker) { if (mGestureDetector.onHoverEvent(event, this, tracker)) return true; diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java index 0ad91dbb0..ea2dacfa0 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java @@ -586,15 +586,22 @@ public class LatinKeyboardBaseView extends KeyboardView implements PointerTracke return super.dispatchPopulateAccessibilityEvent(event); } - public boolean onHoverEvent(MotionEvent event) { - // Since reflection doesn't support calling superclass methods, this - // method checks for the existence of onHoverEvent() in the View class - // before returning a value. + /** + * Receives hover events from the input framework. This method overrides + * View.dispatchHoverEvent(MotionEvent) on SDK version ICS or higher. On + * lower SDK versions, this method is never called. + * + * @param event The motion event to be dispatched. + * @return {@code true} if the event was handled by the view, {@code false} + * otherwise + */ + public boolean dispatchHoverEvent(MotionEvent event) { if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) { final PointerTracker tracker = getPointerTracker(0); - return AccessibleKeyboardViewProxy.getInstance().onHoverEvent(event, tracker); + return AccessibleKeyboardViewProxy.getInstance().dispatchHoverEvent(event, tracker); } + // Reflection doesn't support calling superclass methods. return false; } }