TouchExplorer: reset hover event timer on ACTION_UP.
This insures that users have the correct interval between taps.
Fix: 326260351
Flag: reset_hover_event_timer_on_action_up
Test: atest TouchExplorerTest -- --test-arg com.android.tradefed.testtype.AndroidJUnitTest:instrumentation-arg:randomize:=true --test-arg com.android.tradefed.testtype.AndroidJUnitTest:instrumentation-arg:randomSeed:=-9204845749734110277
Change-Id: I82a8dc36d956b8d184f30554f3721946f2eb61d0
diff --git a/services/accessibility/accessibility.aconfig b/services/accessibility/accessibility.aconfig
index 015c35e..e10ecad 100644
--- a/services/accessibility/accessibility.aconfig
+++ b/services/accessibility/accessibility.aconfig
@@ -80,6 +80,16 @@
}
flag {
+ name: "reset_hover_event_timer_on_action_up"
+ namespace: "accessibility"
+ description: "Reset the timer for sending hover events on receiving ACTION_UP to guarantee the correct amount of time is available between taps."
+ bug: "326260351"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "scan_packages_without_lock"
namespace: "accessibility"
description: "Scans packages for accessibility service/activity info without holding the A11yMS lock"
diff --git a/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java b/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
index 3086ce1..4fc65bf 100644
--- a/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
+++ b/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
@@ -852,6 +852,11 @@
final int pointerIdBits = (1 << pointerId);
if (mSendHoverEnterAndMoveDelayed.isPending()) {
// If we have not delivered the enter schedule an exit.
+ if (Flags.resetHoverEventTimerOnActionUp()) {
+ // We cancel first to reset the time window so that the user has the full amount of
+ // time to do a multi tap.
+ mSendHoverEnterAndMoveDelayed.repost();
+ }
mSendHoverExitDelayed.post(event, rawEvent, pointerIdBits, policyFlags);
} else {
// The user is touch exploring so we send events for end.
@@ -1554,6 +1559,14 @@
}
}
+ public void repost() {
+ // cancel without clearing
+ if (isPending()) {
+ mHandler.removeCallbacks(this);
+ mHandler.postDelayed(this, mDetermineUserIntentTimeout);
+ }
+ }
+
private boolean isPending() {
return mHandler.hasCallbacks(this);
}