aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-06-03 07:32:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-03 07:32:52 +0000
commit9a2162e6f29c92e34161accee3e58fda8fd2998b (patch)
tree40ca5d62b74a8e60298584af97c0e3a0ed1e1a05 /java/src
parent7a750ca50d0ebe6bb5f395479ae2bef355c0a5dd (diff)
parent2351b4f74f1106944b183abbfbccd35a70a00cfb (diff)
downloadlatinime-9a2162e6f29c92e34161accee3e58fda8fd2998b.tar.gz
latinime-9a2162e6f29c92e34161accee3e58fda8fd2998b.tar.xz
latinime-9a2162e6f29c92e34161accee3e58fda8fd2998b.zip
Merge "Fix synthesizing MotionEvent"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java
index 398a933df..bbc18f020 100644
--- a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java
@@ -248,19 +248,15 @@ public class KeyboardAccessibilityDelegate<KV extends KeyboardView>
* Synthesize a touch event from a hover event.
*
* @param touchAction The action of the synthesizing touch event.
- * @param event The base hover event from that the touch event is synthesized.
+ * @param hoverEvent The base hover event from that the touch event is synthesized.
* @return The synthesized touch event of <code>touchAction</code> that has pointer information
* of <code>event</code>.
*/
protected static MotionEvent synthesizeTouchEvent(final int touchAction,
- final MotionEvent event) {
- final long downTime = event.getDownTime();
- final long eventTime = event.getEventTime();
- final int actionIndex = event.getActionIndex();
- final float x = event.getX(actionIndex);
- final float y = event.getY(actionIndex);
- final int pointerId = event.getPointerId(actionIndex);
- return MotionEvent.obtain(downTime, eventTime, touchAction, x, y, pointerId);
+ final MotionEvent hoverEvent) {
+ final MotionEvent touchEvent = MotionEvent.obtain(hoverEvent);
+ touchEvent.setAction(touchAction);
+ return touchEvent;
}
/**