Skip to content

Commit 3c396fc

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Reducing the click delay while screen magnification is enabled." into jb-mr1-dev
2 parents 4e2eb65 + 86fe9e1 commit 3c396fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

services/java/com/android/server/accessibility/ScreenMagnifier.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public final class ScreenMagnifier implements EventStreamTransformation {
128128
private static final int DEFAULT_SCREEN_MAGNIFICATION_AUTO_UPDATE = 1;
129129
private static final float DEFAULT_WINDOW_ANIMATION_SCALE = 1.0f;
130130

131+
private static final int MULTI_TAP_TIME_SLOP_ADJUSTMENT = 50;
132+
131133
private final IWindowManager mWindowManagerService = IWindowManager.Stub.asInterface(
132134
ServiceManager.getService("window"));
133135
private final WindowManager mWindowManager;
@@ -145,7 +147,8 @@ public final class ScreenMagnifier implements EventStreamTransformation {
145147
private final Viewport mViewport;
146148

147149
private final int mTapTimeSlop = ViewConfiguration.getTapTimeout();
148-
private final int mMultiTapTimeSlop = ViewConfiguration.getDoubleTapTimeout();
150+
private final int mMultiTapTimeSlop =
151+
ViewConfiguration.getDoubleTapTimeout() - MULTI_TAP_TIME_SLOP_ADJUSTMENT;
149152
private final int mTapDistanceSlop;
150153
private final int mMultiTapDistanceSlop;
151154

@@ -617,7 +620,7 @@ public void onMotionEvent(MotionEvent event, int policyFlags) {
617620
} else if (mTapCount < ACTION_TAP_COUNT) {
618621
Message message = mHandler.obtainMessage(
619622
MESSAGE_TRANSITION_TO_DELEGATING_STATE);
620-
mHandler.sendMessageDelayed(message, mTapTimeSlop + mMultiTapDistanceSlop);
623+
mHandler.sendMessageDelayed(message, mMultiTapTimeSlop);
621624
}
622625
clearLastDownEvent();
623626
mLastDownEvent = MotionEvent.obtain(event);

0 commit comments

Comments
 (0)