summaryrefslogtreecommitdiff
path: root/services/accessibility
diff options
context:
space:
mode:
authorryanlwlin <ryanlwlin@google.com>2020-08-27 18:58:24 +0800
committerAmeer Armaly <aarmaly@google.com>2020-10-13 20:14:56 +0000
commitbf402bd69882538acacc42baec09d8f95c53a2f7 (patch)
treecee2234dbee0d2460260b97e9154c9b47e6bb917 /services/accessibility
parenta070cca5e207a6f475e467adf123ecf1285f8bbf (diff)
[DO NOT MERGE] Fix Accidently trigger A11y button long pressed
We used the original down location while injecting all down events. It accidently increases the velocity in the beginning and cause Launcher detect the gesture into unexpected state. Test: manually Bug: 162521649 Change-Id: I527f3e785ee1082f86ef1a60e57ccd825bdfeae9
Diffstat (limited to 'services/accessibility')
-rw-r--r--services/accessibility/java/com/android/server/accessibility/gestures/EventDispatcher.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/gestures/EventDispatcher.java b/services/accessibility/java/com/android/server/accessibility/gestures/EventDispatcher.java
index c70dfcc93e49..a4fec82bcf56 100644
--- a/services/accessibility/java/com/android/server/accessibility/gestures/EventDispatcher.java
+++ b/services/accessibility/java/com/android/server/accessibility/gestures/EventDispatcher.java
@@ -287,7 +287,9 @@ class EventDispatcher {
/**
* Sends down events to the view hierarchy for all pointers which are not already being
- * delivered with original down location. i.e. pointers that are not yet injected.
+ * delivered with original down location. i.e. pointers that are not yet injected. The down time
+ * is also replaced by the original one.
+ *
*
* @param prototype The prototype from which to create the injected events.
* @param policyFlags The policy flags associated with the event.
@@ -336,7 +338,10 @@ class EventDispatcher {
MotionEvent event =
MotionEvent.obtain(
prototype.getDownTime(),
- prototype.getEventTime(),
+ // The event time is used for downTime while sending ACTION_DOWN. We adjust
+ // it to avoid the motion velocity is too fast in the beginning after
+ // Delegating.
+ prototype.getDownTime(),
prototype.getAction(),
pointerCount,
properties,