Loading services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java +2 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,7 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH mScaleGestureDetector = new ScaleGestureDetector(context, this, Handler.getMain()); mScaleGestureDetector.setQuickScaleEnabled(false); mScrollGestureDetector = new GestureDetector(context, this, Handler.getMain()); mScrollGestureDetector.setIsLongpressEnabled(false); } @Override Loading Loading @@ -1876,6 +1877,7 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH private MotionEventInfo mEvent; SinglePanningState(Context context) { mScrollGestureDetector = new GestureDetector(context, this, Handler.getMain()); mScrollGestureDetector.setIsLongpressEnabled(false); } @Override Loading services/tests/servicestests/src/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandlerTest.java +25 −8 Original line number Diff line number Diff line Loading @@ -620,7 +620,7 @@ public class FullScreenMagnificationGestureHandlerTest { @Test @RequiresFlagsEnabled(Flags.FLAG_ENABLE_MAGNIFICATION_MULTIPLE_FINGER_MULTIPLE_TAP_GESTURE) public void testTwoFingerTap_StateIsActivated_shouldInDelegating() { public void testTwoFingerTap_StateIsActivated_shouldInDetecting() { assumeTrue(isWatch()); enableOneFingerPanning(false); goFromStateIdleTo(STATE_ACTIVATED); Loading @@ -629,14 +629,15 @@ public class FullScreenMagnificationGestureHandlerTest { send(downEvent()); send(pointerEvent(ACTION_POINTER_DOWN, DEFAULT_X * 2, DEFAULT_Y)); send(upEvent()); fastForward(ViewConfiguration.getDoubleTapTimeout()); fastForward(mMgh.mDetectingState.mMultiTapMaxDelay); assertTrue(mMgh.mCurrentState == mMgh.mDelegatingState); verify(mMgh.getNext(), times(3)).onMotionEvent(any(), any(), anyInt()); assertTrue(mMgh.mCurrentState == mMgh.mDetectingState); } @Test @RequiresFlagsEnabled(Flags.FLAG_ENABLE_MAGNIFICATION_MULTIPLE_FINGER_MULTIPLE_TAP_GESTURE) public void testTwoFingerTap_StateIsIdle_shouldInDelegating() { public void testTwoFingerTap_StateIsIdle_shouldInDetecting() { assumeTrue(isWatch()); enableOneFingerPanning(false); goFromStateIdleTo(STATE_IDLE); Loading @@ -645,9 +646,10 @@ public class FullScreenMagnificationGestureHandlerTest { send(downEvent()); send(pointerEvent(ACTION_POINTER_DOWN, DEFAULT_X * 2, DEFAULT_Y)); send(upEvent()); fastForward(ViewConfiguration.getDoubleTapTimeout()); fastForward(mMgh.mDetectingState.mMultiTapMaxDelay); assertTrue(mMgh.mCurrentState == mMgh.mDelegatingState); verify(mMgh.getNext(), times(3)).onMotionEvent(any(), any(), anyInt()); assertTrue(mMgh.mCurrentState == mMgh.mDetectingState); } @Test Loading Loading @@ -1057,9 +1059,24 @@ public class FullScreenMagnificationGestureHandlerTest { assumeTrue(isWatch()); goFromStateIdleTo(STATE_ACTIVATED); swipeAndHold(); PointF pointer = DEFAULT_POINT; send(downEvent(pointer.x, pointer.y)); // first move triggers the panning state pointer.offset(100, 100); fastForward(20); send(moveEvent(pointer.x, pointer.y)); // second move actually pans pointer.offset(100, 100); fastForward(20); send(moveEvent(pointer.x, pointer.y)); pointer.offset(100, 100); fastForward(20); send(moveEvent(pointer.x, pointer.y)); fastForward(20); swipe(DEFAULT_POINT, new PointF(DEFAULT_X * 2, DEFAULT_Y * 2), /* durationMs= */ 20); send(upEvent(pointer.x, pointer.y)); verify(mMockScroller).fling( /* startX= */ anyInt(), Loading Loading
services/accessibility/java/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandler.java +2 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,7 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH mScaleGestureDetector = new ScaleGestureDetector(context, this, Handler.getMain()); mScaleGestureDetector.setQuickScaleEnabled(false); mScrollGestureDetector = new GestureDetector(context, this, Handler.getMain()); mScrollGestureDetector.setIsLongpressEnabled(false); } @Override Loading Loading @@ -1876,6 +1877,7 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH private MotionEventInfo mEvent; SinglePanningState(Context context) { mScrollGestureDetector = new GestureDetector(context, this, Handler.getMain()); mScrollGestureDetector.setIsLongpressEnabled(false); } @Override Loading
services/tests/servicestests/src/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandlerTest.java +25 −8 Original line number Diff line number Diff line Loading @@ -620,7 +620,7 @@ public class FullScreenMagnificationGestureHandlerTest { @Test @RequiresFlagsEnabled(Flags.FLAG_ENABLE_MAGNIFICATION_MULTIPLE_FINGER_MULTIPLE_TAP_GESTURE) public void testTwoFingerTap_StateIsActivated_shouldInDelegating() { public void testTwoFingerTap_StateIsActivated_shouldInDetecting() { assumeTrue(isWatch()); enableOneFingerPanning(false); goFromStateIdleTo(STATE_ACTIVATED); Loading @@ -629,14 +629,15 @@ public class FullScreenMagnificationGestureHandlerTest { send(downEvent()); send(pointerEvent(ACTION_POINTER_DOWN, DEFAULT_X * 2, DEFAULT_Y)); send(upEvent()); fastForward(ViewConfiguration.getDoubleTapTimeout()); fastForward(mMgh.mDetectingState.mMultiTapMaxDelay); assertTrue(mMgh.mCurrentState == mMgh.mDelegatingState); verify(mMgh.getNext(), times(3)).onMotionEvent(any(), any(), anyInt()); assertTrue(mMgh.mCurrentState == mMgh.mDetectingState); } @Test @RequiresFlagsEnabled(Flags.FLAG_ENABLE_MAGNIFICATION_MULTIPLE_FINGER_MULTIPLE_TAP_GESTURE) public void testTwoFingerTap_StateIsIdle_shouldInDelegating() { public void testTwoFingerTap_StateIsIdle_shouldInDetecting() { assumeTrue(isWatch()); enableOneFingerPanning(false); goFromStateIdleTo(STATE_IDLE); Loading @@ -645,9 +646,10 @@ public class FullScreenMagnificationGestureHandlerTest { send(downEvent()); send(pointerEvent(ACTION_POINTER_DOWN, DEFAULT_X * 2, DEFAULT_Y)); send(upEvent()); fastForward(ViewConfiguration.getDoubleTapTimeout()); fastForward(mMgh.mDetectingState.mMultiTapMaxDelay); assertTrue(mMgh.mCurrentState == mMgh.mDelegatingState); verify(mMgh.getNext(), times(3)).onMotionEvent(any(), any(), anyInt()); assertTrue(mMgh.mCurrentState == mMgh.mDetectingState); } @Test Loading Loading @@ -1057,9 +1059,24 @@ public class FullScreenMagnificationGestureHandlerTest { assumeTrue(isWatch()); goFromStateIdleTo(STATE_ACTIVATED); swipeAndHold(); PointF pointer = DEFAULT_POINT; send(downEvent(pointer.x, pointer.y)); // first move triggers the panning state pointer.offset(100, 100); fastForward(20); send(moveEvent(pointer.x, pointer.y)); // second move actually pans pointer.offset(100, 100); fastForward(20); send(moveEvent(pointer.x, pointer.y)); pointer.offset(100, 100); fastForward(20); send(moveEvent(pointer.x, pointer.y)); fastForward(20); swipe(DEFAULT_POINT, new PointF(DEFAULT_X * 2, DEFAULT_Y * 2), /* durationMs= */ 20); send(upEvent(pointer.x, pointer.y)); verify(mMockScroller).fling( /* startX= */ anyInt(), Loading