From 6a23b9e3d54031524445b1190cc1eba77916c5b3 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 20 Dec 2013 12:07:33 +0900 Subject: [PATCH] Remove PointerTracker reference from accessibility package Change-Id: I1a88d9fc4db437070778ea1256aae17c32428729 --- .../accessibility/AccessibleKeyboardViewProxy.java | 8 +++++--- .../android/inputmethod/keyboard/MainKeyboardView.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java index c601cf17e..d0d5399c6 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java @@ -29,10 +29,10 @@ import android.view.ViewParent; import android.view.accessibility.AccessibilityEvent; import com.android.inputmethod.keyboard.Key; +import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.MainKeyboardView; -import com.android.inputmethod.keyboard.PointerTracker; import com.android.inputmethod.latin.R; public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat { @@ -220,9 +220,11 @@ public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateComp * Receives hover events when touch exploration is turned on in SDK versions ICS and higher. * * @param event The hover event. + * @param keyDetector The {@link KeyDetector} to determine on which key the event + * is hovering. * @return {@code true} if the event is handled */ - public boolean dispatchHoverEvent(final MotionEvent event, final PointerTracker tracker) { + public boolean dispatchHoverEvent(final MotionEvent event, final KeyDetector keyDetector) { if (mView == null) { return false; } @@ -233,7 +235,7 @@ public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateComp final Key key; if (pointInView(x, y)) { - key = tracker.getKeyOn(x, y); + key = keyDetector.detectHitKey(x, y); } else { key = null; } diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 4b6e12f8e..b4609d051 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -1039,8 +1039,8 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack @Override public boolean dispatchHoverEvent(final MotionEvent event) { if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) { - final PointerTracker tracker = PointerTracker.getPointerTracker(0); - return AccessibleKeyboardViewProxy.getInstance().dispatchHoverEvent(event, tracker); + return AccessibleKeyboardViewProxy.getInstance().dispatchHoverEvent( + event, mKeyDetector); } // Reflection doesn't support calling superclass methods.