Fixed duplicate call to dispatchOnPopulateAccessibilityEvent()

Bug: 5060194
Change-Id: I585ae52204a045fa3941e846b4f9bdd7d541bea6
main
Alan Viverette 2011-07-26 14:06:26 -07:00
parent e9d74adcc8
commit 586a15c3f0
2 changed files with 15 additions and 8 deletions

View File

@ -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;

View File

@ -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;
}
}