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

Commit 289b640d authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Gerrit Code Review
Browse files

Merge "Disable touch while using the stylus (Galaxy Note)" into cm-10.1

parents 6164353d bea3f86b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5295,6 +5295,7 @@ void TouchInputMapper::dispatchPointerStylus(nsecs_t when, uint32_t policyFlags)
        mPointerSimple.currentProperties.id = 0;
        mPointerSimple.currentProperties.toolType =
                mCurrentCookedPointerData.pointerProperties[index].toolType;
        mLastStylusTime = when;
    } else {
        down = false;
        hovering = false;
@@ -5377,6 +5378,11 @@ void TouchInputMapper::dispatchPointerSimple(nsecs_t when, uint32_t policyFlags,
        }
    }

    if (rejectPalm(when)) {     // stylus is currently active
        mPointerSimple.reset();
        return;
    }

    if (mPointerSimple.down && !down) {
        mPointerSimple.down = false;

@@ -5494,6 +5500,9 @@ void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32
        const PointerProperties* properties, const PointerCoords* coords,
        const uint32_t* idToIndex, BitSet32 idBits,
        int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime) {

    if (rejectPalm(when)) return;

    PointerCoords pointerCoords[MAX_POINTERS];
    PointerProperties pointerProperties[MAX_POINTERS];
    uint32_t pointerCount = 0;
+3 −0
Original line number Diff line number Diff line
@@ -1610,6 +1610,9 @@ private:
    VelocityControl mWheelXVelocityControl;
    VelocityControl mWheelYVelocityControl;

    // The time the stylus event was processed by any TouchInputMapper
    static nsecs_t mLastStylusTime;

    void sync(nsecs_t when);

    bool consumeRawTouches(nsecs_t when, uint32_t policyFlags);