From 166530b1950543b0f918055411b9a0c5960a769b Mon Sep 17 00:00:00 2001
From: Alan Viverette <alanv@google.com>
Date: Wed, 26 Oct 2011 18:52:08 -0700
Subject: [PATCH] Removed lift-to-type from LatinIME accessibility.

Bug: 5522854
Change-Id: I32df86450fa0d5dd9606609ea693d0e331b64b19
---
 .../AccessibleKeyboardViewProxy.java          | 30 -------------------
 .../keyboard/LatinKeyboardView.java           | 10 -------
 2 files changed, 40 deletions(-)

diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
index 4c109c7088..cef82267fd 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
@@ -23,7 +23,6 @@ import android.graphics.Paint;
 import android.inputmethodservice.InputMethodService;
 import android.util.Log;
 import android.view.MotionEvent;
-import android.view.ViewConfiguration;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.inputmethod.EditorInfo;
 
@@ -38,18 +37,12 @@ public class AccessibleKeyboardViewProxy {
     private static final String TAG = AccessibleKeyboardViewProxy.class.getSimpleName();
     private static final AccessibleKeyboardViewProxy sInstance = new AccessibleKeyboardViewProxy();
 
-    // Delay in milliseconds between key press DOWN and UP events
-    private static final long DELAY_KEY_PRESS = 10;
-
     private InputMethodService mInputMethod;
     private FlickGestureDetector mGestureDetector;
     private LatinKeyboardView mView;
     private AccessibleKeyboardActionListener mListener;
 
-    private int mScaledEdgeSlop;
     private int mLastHoverKeyIndex = KeyDetector.NOT_A_KEY;
-    private int mLastX = -1;
-    private int mLastY = -1;
 
     public static void init(InputMethodService inputMethod, SharedPreferences prefs) {
         sInstance.initInternal(inputMethod, prefs);
@@ -77,7 +70,6 @@ public class AccessibleKeyboardViewProxy {
 
         mInputMethod = inputMethod;
         mGestureDetector = new KeyboardFlickGestureDetector(inputMethod);
-        mScaledEdgeSlop = ViewConfiguration.get(inputMethod).getScaledEdgeSlop();
     }
 
     public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event,
@@ -143,26 +135,9 @@ public class AccessibleKeyboardViewProxy {
             if (keyIndex != mLastHoverKeyIndex) {
                 fireKeyHoverEvent(tracker, mLastHoverKeyIndex, false);
                 mLastHoverKeyIndex = keyIndex;
-                mLastX = x;
-                mLastY = y;
                 fireKeyHoverEvent(tracker, mLastHoverKeyIndex, true);
             }
 
-            return true;
-        case MotionEventCompatUtils.ACTION_HOVER_EXIT:
-            final int width = mView.getWidth();
-            final int height = mView.getHeight();
-
-            if (x < mScaledEdgeSlop || y < mScaledEdgeSlop || x >= (width - mScaledEdgeSlop)
-                    || y >= (height - mScaledEdgeSlop)) {
-                fireKeyHoverEvent(tracker, mLastHoverKeyIndex, false);
-                mLastHoverKeyIndex = KeyDetector.NOT_A_KEY;
-                mLastX = -1;
-                mLastY = -1;
-            } else if (mLastHoverKeyIndex != KeyDetector.NOT_A_KEY) {
-                fireKeyPressEvent(tracker, mLastX, mLastY, event.getEventTime());
-            }
-
             return true;
         }
 
@@ -197,11 +172,6 @@ public class AccessibleKeyboardViewProxy {
         }
     }
 
-    private void fireKeyPressEvent(PointerTracker tracker, int x, int y, long eventTime) {
-        tracker.onDownEvent(x, y, eventTime, mView);
-        tracker.onUpEvent(x, y, eventTime + DELAY_KEY_PRESS);
-    }
-
     private class KeyboardFlickGestureDetector extends FlickGestureDetector {
         public KeyboardFlickGestureDetector(Context context) {
             super(context);
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index a24195e87d..aab52e1392 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -623,16 +623,6 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
         VoiceProxy.getInstance().onAttachedToWindow();
     }
 
-    @Override
-    public boolean dispatchTouchEvent(MotionEvent event) {
-        // Drop non-hover touch events when touch exploration is enabled.
-        if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
-            return false;
-        }
-
-        return super.dispatchTouchEvent(event);
-    }
-
     @Override
     public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
         if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
-- 
GitLab