summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/accessibility/accessibility.aconfig7
-rw-r--r--services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java18
-rw-r--r--services/tests/servicestests/src/com/android/server/accessibility/gestures/TouchExplorerTest.java61
3 files changed, 12 insertions, 74 deletions
diff --git a/services/accessibility/accessibility.aconfig b/services/accessibility/accessibility.aconfig
index a19920f4fc02..993b2544f110 100644
--- a/services/accessibility/accessibility.aconfig
+++ b/services/accessibility/accessibility.aconfig
@@ -59,13 +59,6 @@ flag {
}
flag {
- name: "reduce_touch_exploration_sensitivity"
- namespace: "accessibility"
- description: "Reduces touch exploration sensitivity by only sending a hover event when the ifnger has moved the amount of pixels defined by the system's touch slop."
- bug: "303677860"
-}
-
-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 fc8d4f89e6a7..c4184854e690 100644
--- a/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
+++ b/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
@@ -882,22 +882,10 @@ public class TouchExplorer extends BaseEventStreamTransformation
final int pointerIndex = event.findPointerIndex(pointerId);
switch (event.getPointerCount()) {
case 1:
- // Touch exploration.
+ // Touch exploration.
sendTouchExplorationGestureStartAndHoverEnterIfNeeded(policyFlags);
- if (Flags.reduceTouchExplorationSensitivity()
- && mState.getLastInjectedHoverEvent() != null) {
- final MotionEvent lastEvent = mState.getLastInjectedHoverEvent();
- final float deltaX = lastEvent.getX() - rawEvent.getX();
- final float deltaY = lastEvent.getY() - rawEvent.getY();
- final double moveDelta = Math.hypot(deltaX, deltaY);
- if (moveDelta > mTouchSlop) {
- mDispatcher.sendMotionEvent(
- event, ACTION_HOVER_MOVE, rawEvent, pointerIdBits, policyFlags);
- }
- } else {
- mDispatcher.sendMotionEvent(
- event, ACTION_HOVER_MOVE, rawEvent, pointerIdBits, policyFlags);
- }
+ mDispatcher.sendMotionEvent(
+ event, ACTION_HOVER_MOVE, rawEvent, pointerIdBits, policyFlags);
break;
case 2:
if (mGestureDetector.isMultiFingerGesturesEnabled()
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/gestures/TouchExplorerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/gestures/TouchExplorerTest.java
index efcdbd488a39..1cd61e90126e 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/gestures/TouchExplorerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/gestures/TouchExplorerTest.java
@@ -44,10 +44,6 @@ import android.content.Context;
import android.graphics.PointF;
import android.os.Looper;
import android.os.SystemClock;
-import android.platform.test.annotations.RequiresFlagsDisabled;
-import android.platform.test.annotations.RequiresFlagsEnabled;
-import android.platform.test.flag.junit.CheckFlagsRule;
-import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.testing.DexmakerShareClassLoaderRule;
import android.view.InputDevice;
import android.view.MotionEvent;
@@ -60,7 +56,6 @@ import androidx.test.runner.AndroidJUnit4;
import com.android.server.accessibility.AccessibilityManagerService;
import com.android.server.accessibility.AccessibilityTraceManager;
import com.android.server.accessibility.EventStreamTransformation;
-import com.android.server.accessibility.Flags;
import com.android.server.accessibility.utils.GestureLogParser;
import com.android.server.testutils.OffsettableClock;
@@ -81,7 +76,6 @@ import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
-
@RunWith(AndroidJUnit4.class)
public class TouchExplorerTest {
@@ -125,9 +119,6 @@ public class TouchExplorerTest {
public final DexmakerShareClassLoaderRule mDexmakerShareClassLoaderRule =
new DexmakerShareClassLoaderRule();
- @Rule
- public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
-
/**
* {@link TouchExplorer#sendDownForAllNotInjectedPointers} injecting events with the same object
* is resulting {@link ArgumentCaptor} to capture events with last state. Before implementation
@@ -170,42 +161,11 @@ public class TouchExplorerTest {
goFromStateClearTo(STATE_TOUCH_EXPLORING_1FINGER);
// Wait for transiting to touch exploring state.
mHandler.fastForward(2 * USER_INTENT_TIMEOUT);
- assertState(STATE_TOUCH_EXPLORING);
- // Manually construct the next move event. Using moveEachPointers() will batch the move
- // event which produces zero movement for some reason.
- float[] x = new float[1];
- float[] y = new float[1];
- x[0] = mLastEvent.getX(0) + mTouchSlop;
- y[0] = mLastEvent.getY(0) + mTouchSlop;
- send(manyPointerEvent(ACTION_MOVE, x, y));
- goToStateClearFrom(STATE_TOUCH_EXPLORING_1FINGER);
- assertCapturedEvents(ACTION_HOVER_ENTER, ACTION_HOVER_MOVE, ACTION_HOVER_EXIT);
- }
-
- /**
- * Test the case where ACTION_DOWN is followed by a number of ACTION_MOVE events that do not
- * change the coordinates.
- */
- @Test
- @RequiresFlagsEnabled(Flags.FLAG_REDUCE_TOUCH_EXPLORATION_SENSITIVITY)
- public void testOneFingerMoveWithExtraMoveEvents_generatesOneMoveEvent() {
- goFromStateClearTo(STATE_TOUCH_EXPLORING_1FINGER);
- // Inject a set of move events that have the same coordinates as the down event.
- moveEachPointers(mLastEvent, p(0, 0));
- send(mLastEvent);
- // Wait for transition to touch exploring state.
- mHandler.fastForward(2 * USER_INTENT_TIMEOUT);
- // Now move for real.
- moveAtLeastTouchSlop(mLastEvent);
- send(mLastEvent);
- // One more move event with no change.
- moveEachPointers(mLastEvent, p(0, 0));
+ moveEachPointers(mLastEvent, p(10, 10));
send(mLastEvent);
goToStateClearFrom(STATE_TOUCH_EXPLORING_1FINGER);
- assertCapturedEvents(
- ACTION_HOVER_ENTER,
- ACTION_HOVER_MOVE,
- ACTION_HOVER_EXIT);
+ assertCapturedEvents(ACTION_HOVER_ENTER, ACTION_HOVER_MOVE, ACTION_HOVER_EXIT);
+ assertState(STATE_TOUCH_EXPLORING);
}
/**
@@ -213,8 +173,7 @@ public class TouchExplorerTest {
* change the coordinates.
*/
@Test
- @RequiresFlagsDisabled(Flags.FLAG_REDUCE_TOUCH_EXPLORATION_SENSITIVITY)
- public void testOneFingerMoveWithExtraMoveEvents_generatesThreeMoveEvent() {
+ public void testOneFingerMoveWithExtraMoveEvents() {
goFromStateClearTo(STATE_TOUCH_EXPLORING_1FINGER);
// Inject a set of move events that have the same coordinates as the down event.
moveEachPointers(mLastEvent, p(0, 0));
@@ -222,7 +181,7 @@ public class TouchExplorerTest {
// Wait for transition to touch exploring state.
mHandler.fastForward(2 * USER_INTENT_TIMEOUT);
// Now move for real.
- moveAtLeastTouchSlop(mLastEvent);
+ moveEachPointers(mLastEvent, p(10, 10));
send(mLastEvent);
// One more move event with no change.
moveEachPointers(mLastEvent, p(0, 0));
@@ -283,7 +242,7 @@ public class TouchExplorerTest {
moveEachPointers(mLastEvent, p(0, 0), p(0, 0));
send(mLastEvent);
// Now move for real.
- moveEachPointers(mLastEvent, p(mTouchSlop, mTouchSlop), p(mTouchSlop, mTouchSlop));
+ moveEachPointers(mLastEvent, p(10, 10), p(10, 10));
send(mLastEvent);
goToStateClearFrom(STATE_DRAGGING_2FINGERS);
assertCapturedEvents(ACTION_DOWN, ACTION_MOVE, ACTION_MOVE, ACTION_MOVE, ACTION_UP);
@@ -292,7 +251,7 @@ public class TouchExplorerTest {
@Test
public void testUpEvent_OneFingerMove_clearStateAndInjectHoverEvents() {
goFromStateClearTo(STATE_TOUCH_EXPLORING_1FINGER);
- moveAtLeastTouchSlop(mLastEvent);
+ moveEachPointers(mLastEvent, p(10, 10));
send(mLastEvent);
// Wait 10 ms to make sure that hover enter and exit are not scheduled for the same moment.
mHandler.fastForward(10);
@@ -318,7 +277,7 @@ public class TouchExplorerTest {
// Wait for the finger moving to the second view.
mHandler.fastForward(oneThirdUserIntentTimeout);
- moveAtLeastTouchSlop(mLastEvent);
+ moveEachPointers(mLastEvent, p(10, 10));
send(mLastEvent);
// Wait for the finger lifting from the second view.
@@ -443,6 +402,7 @@ public class TouchExplorerTest {
// Manually construct the next move event. Using moveEachPointers() will batch the move
// event onto the pointer up event which will mean that the move event still has a pointer
// count of 3.
+ // Todo: refactor to avoid using batching as there is no special reason to do it that way.
float[] x = new float[2];
float[] y = new float[2];
x[0] = mLastEvent.getX(0) + 100;
@@ -774,9 +734,6 @@ public class TouchExplorerTest {
}
}
- private void moveAtLeastTouchSlop(MotionEvent event) {
- moveEachPointers(event, p(2 * mTouchSlop, 0));
- }
/**
* A {@link android.os.Handler} that doesn't process messages until {@link #fastForward(int)} is
* invoked.