Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed48fa89 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Touch pad improvements. Bug: 4124987" into honeycomb-mr2

parents c1830a77 bb3fcba0
Loading
Loading
Loading
Loading
+37 −3
Original line number Diff line number Diff line
@@ -112,6 +112,20 @@ public class ViewConfiguration {
     */
    private static final int DOUBLE_TAP_TIMEOUT = 300;

    /**
     * Defines the maximum duration in milliseconds between a touch pad
     * touch and release for a given touch to be considered a tap (click) as
     * opposed to a hover movement gesture.
     */
    private static final int HOVER_TAP_TIMEOUT = 150;

    /**
     * Defines the maximum distance in pixels that a touch pad touch can move
     * before being released for it to be considered a tap (click) as opposed
     * to a hover movement gesture.
     */
    private static final int HOVER_TAP_SLOP = 20;

    /**
     * Defines the duration in milliseconds we want to display zoom controls in response 
     * to a user panning within an application.
@@ -379,6 +393,26 @@ public class ViewConfiguration {
        return DOUBLE_TAP_TIMEOUT;
    }

    /**
     * @return the maximum duration in milliseconds between a touch pad
     * touch and release for a given touch to be considered a tap (click) as
     * opposed to a hover movement gesture.
     * @hide
     */
    public static int getHoverTapTimeout() {
        return HOVER_TAP_TIMEOUT;
    }

    /**
     * @return the maximum distance in pixels that a touch pad touch can move
     * before being released for it to be considered a tap (click) as opposed
     * to a hover movement gesture.
     * @hide
     */
    public static int getHoverTapSlop() {
        return HOVER_TAP_SLOP;
    }

    /**
     * @return Inset in pixels to look for touchable content when the user touches the edge of the
     *         screen
+173 −155

File changed.

Preview size limit exceeded, changes collapsed.

+6 −7
Original line number Diff line number Diff line
@@ -101,8 +101,8 @@ struct InputReaderConfiguration {
    nsecs_t pointerGestureMultitouchSettleInterval;

    // The transition from PRESS to SWIPE or FREEFORM gesture mode is made when
    // both of the pointers are moving at least this fast.
    float pointerGestureMultitouchMinSpeed; // in pixels per second
    // at least two pointers have moved at least this far from their starting place.
    float pointerGestureMultitouchMinDistance; // in pixels

    // The transition from PRESS to SWIPE gesture mode can only occur when the
    // cosine of the angle between the two vectors is greater than or equal to than this value
@@ -134,7 +134,7 @@ struct InputReaderConfiguration {
            filterTouchEvents(false),
            filterJumpyTouchEvents(false),
            virtualKeyQuietTime(0),
            pointerVelocityControlParameters(1.0f, 80.0f, 400.0f, 4.0f),
            pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f, 3.0f),
            wheelVelocityControlParameters(1.0f, 15.0f, 50.0f, 4.0f),
            pointerGestureQuietInterval(100 * 1000000LL), // 100 ms
            pointerGestureDragMinSwitchSpeed(50), // 50 pixels per second
@@ -142,10 +142,10 @@ struct InputReaderConfiguration {
            pointerGestureTapDragInterval(150 * 1000000LL), // 150 ms
            pointerGestureTapSlop(10.0f), // 10 pixels
            pointerGestureMultitouchSettleInterval(100 * 1000000LL), // 100 ms
            pointerGestureMultitouchMinSpeed(150.0f), // 150 pixels per second
            pointerGestureMultitouchMinDistance(15), // 15 pixels
            pointerGestureSwipeTransitionAngleCosine(0.5f), // cosine of 45degrees
            pointerGestureSwipeMaxWidthRatio(0.333f),
            pointerGestureMovementSpeedRatio(0.3f),
            pointerGestureSwipeMaxWidthRatio(0.25f),
            pointerGestureMovementSpeedRatio(0.8f),
            pointerGestureZoomSpeedRatio(0.3f) { }
};

@@ -1192,7 +1192,6 @@ private:
    void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout);
    bool preparePointerGestures(nsecs_t when,
            bool* outCancelPreviousGesture, bool* outFinishPreviousGesture, bool isTimeout);
    void moveSpotsLocked();

    // Dispatches a motion event.
    // If the changedId is >= 0 and the action is POINTER_DOWN or POINTER_UP, the
+7 −7
Original line number Diff line number Diff line
@@ -540,8 +540,13 @@ public class InputManager {
        }

        @SuppressWarnings("unused")
        public int getTapTimeout() {
            return ViewConfiguration.getTapTimeout();
        public int getHoverTapTimeout() {
            return ViewConfiguration.getHoverTapTimeout();
        }

        @SuppressWarnings("unused")
        public int getHoverTapSlop() {
            return ViewConfiguration.getHoverTapSlop();
        }

        @SuppressWarnings("unused")
@@ -554,11 +559,6 @@ public class InputManager {
            return ViewConfiguration.getLongPressTimeout();
        }

        @SuppressWarnings("unused")
        public int getTouchSlop() {
            return ViewConfiguration.get(mContext).getScaledTouchSlop();
        }

        @SuppressWarnings("unused")
        public int getMaxEventsPerSecond() {
            int result = 0;
+17 −17

File changed.

Preview size limit exceeded, changes collapsed.