Loading services/inputflinger/InputReader.cpp +26 −3 Original line number Original line Diff line number Diff line Loading @@ -3721,6 +3721,7 @@ void TouchInputMapper::reset(nsecs_t when) { mLastMouseIdBits.clear(); mLastMouseIdBits.clear(); mPointerUsage = POINTER_USAGE_NONE; mPointerUsage = POINTER_USAGE_NONE; mSentHoverEnter = false; mSentHoverEnter = false; mCurrentMotionAborted = false; mDownTime = 0; mDownTime = 0; mCurrentVirtualKey.down = false; mCurrentVirtualKey.down = false; Loading Loading @@ -3874,12 +3875,17 @@ void TouchInputMapper::sync(nsecs_t when) { mCurrentCookedPointerData.idToIndex, mCurrentCookedPointerData.idToIndex, mCurrentCookedPointerData.touchingIdBits); mCurrentCookedPointerData.touchingIdBits); } } if (!mCurrentMotionAborted) { dispatchHoverExit(when, policyFlags); dispatchHoverExit(when, policyFlags); dispatchTouches(when, policyFlags); dispatchTouches(when, policyFlags); dispatchHoverEnterAndMove(when, policyFlags); dispatchHoverEnterAndMove(when, policyFlags); } } if (mCurrentCookedPointerData.pointerCount == 0) { mCurrentMotionAborted = false; } } // Synthesize key up from raw buttons if needed. // Synthesize key up from raw buttons if needed. synthesizeButtonKeys(getContext(), AKEY_EVENT_ACTION_UP, when, getDeviceId(), mSource, synthesizeButtonKeys(getContext(), AKEY_EVENT_ACTION_UP, when, getDeviceId(), mSource, policyFlags, mLastButtonState, mCurrentButtonState); policyFlags, mLastButtonState, mCurrentButtonState); Loading Loading @@ -4018,6 +4024,22 @@ void TouchInputMapper::dispatchVirtualKey(nsecs_t when, uint32_t policyFlags, getListener()->notifyKey(&args); getListener()->notifyKey(&args); } } void TouchInputMapper::abortTouches(nsecs_t when, uint32_t policyFlags) { BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; if (!currentIdBits.isEmpty()) { int32_t metaState = getContext()->getGlobalMetaState(); int32_t buttonState = mCurrentButtonState; dispatchMotion(when, policyFlags, mSource, AMOTION_EVENT_ACTION_CANCEL, 0, metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, mCurrentCookedPointerData.pointerProperties, mCurrentCookedPointerData.pointerCoords, mCurrentCookedPointerData.idToIndex, currentIdBits, -1, mOrientedXPrecision, mOrientedYPrecision, mDownTime); mCurrentMotionAborted = true; } } void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) { void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) { BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; BitSet32 lastIdBits = mLastCookedPointerData.touchingIdBits; BitSet32 lastIdBits = mLastCookedPointerData.touchingIdBits; Loading Loading @@ -5733,6 +5755,7 @@ void TouchInputMapper::fadePointer() { void TouchInputMapper::cancelTouch(nsecs_t when) { void TouchInputMapper::cancelTouch(nsecs_t when) { abortPointerUsage(when, 0 /*policyFlags*/); abortPointerUsage(when, 0 /*policyFlags*/); abortTouches(when, 0 /* policyFlags*/); } } bool TouchInputMapper::isPointInsideSurface(int32_t x, int32_t y) { bool TouchInputMapper::isPointInsideSurface(int32_t x, int32_t y) { Loading services/inputflinger/InputReader.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1364,6 +1364,9 @@ protected: // True if we sent a HOVER_ENTER event. // True if we sent a HOVER_ENTER event. bool mSentHoverEnter; bool mSentHoverEnter; // Is the current stream of direct touch events aborted bool mCurrentMotionAborted; // The time the primary pointer last went down. // The time the primary pointer last went down. nsecs_t mDownTime; nsecs_t mDownTime; Loading Loading @@ -1688,6 +1691,7 @@ private: void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage); void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage); void abortPointerUsage(nsecs_t when, uint32_t policyFlags); void abortPointerUsage(nsecs_t when, uint32_t policyFlags); void abortTouches(nsecs_t when, uint32_t policyFlags); void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout); void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout); void abortPointerGestures(nsecs_t when, uint32_t policyFlags); void abortPointerGestures(nsecs_t when, uint32_t policyFlags); Loading Loading
services/inputflinger/InputReader.cpp +26 −3 Original line number Original line Diff line number Diff line Loading @@ -3721,6 +3721,7 @@ void TouchInputMapper::reset(nsecs_t when) { mLastMouseIdBits.clear(); mLastMouseIdBits.clear(); mPointerUsage = POINTER_USAGE_NONE; mPointerUsage = POINTER_USAGE_NONE; mSentHoverEnter = false; mSentHoverEnter = false; mCurrentMotionAborted = false; mDownTime = 0; mDownTime = 0; mCurrentVirtualKey.down = false; mCurrentVirtualKey.down = false; Loading Loading @@ -3874,12 +3875,17 @@ void TouchInputMapper::sync(nsecs_t when) { mCurrentCookedPointerData.idToIndex, mCurrentCookedPointerData.idToIndex, mCurrentCookedPointerData.touchingIdBits); mCurrentCookedPointerData.touchingIdBits); } } if (!mCurrentMotionAborted) { dispatchHoverExit(when, policyFlags); dispatchHoverExit(when, policyFlags); dispatchTouches(when, policyFlags); dispatchTouches(when, policyFlags); dispatchHoverEnterAndMove(when, policyFlags); dispatchHoverEnterAndMove(when, policyFlags); } } if (mCurrentCookedPointerData.pointerCount == 0) { mCurrentMotionAborted = false; } } // Synthesize key up from raw buttons if needed. // Synthesize key up from raw buttons if needed. synthesizeButtonKeys(getContext(), AKEY_EVENT_ACTION_UP, when, getDeviceId(), mSource, synthesizeButtonKeys(getContext(), AKEY_EVENT_ACTION_UP, when, getDeviceId(), mSource, policyFlags, mLastButtonState, mCurrentButtonState); policyFlags, mLastButtonState, mCurrentButtonState); Loading Loading @@ -4018,6 +4024,22 @@ void TouchInputMapper::dispatchVirtualKey(nsecs_t when, uint32_t policyFlags, getListener()->notifyKey(&args); getListener()->notifyKey(&args); } } void TouchInputMapper::abortTouches(nsecs_t when, uint32_t policyFlags) { BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; if (!currentIdBits.isEmpty()) { int32_t metaState = getContext()->getGlobalMetaState(); int32_t buttonState = mCurrentButtonState; dispatchMotion(when, policyFlags, mSource, AMOTION_EVENT_ACTION_CANCEL, 0, metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, mCurrentCookedPointerData.pointerProperties, mCurrentCookedPointerData.pointerCoords, mCurrentCookedPointerData.idToIndex, currentIdBits, -1, mOrientedXPrecision, mOrientedYPrecision, mDownTime); mCurrentMotionAborted = true; } } void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) { void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) { BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; BitSet32 lastIdBits = mLastCookedPointerData.touchingIdBits; BitSet32 lastIdBits = mLastCookedPointerData.touchingIdBits; Loading Loading @@ -5733,6 +5755,7 @@ void TouchInputMapper::fadePointer() { void TouchInputMapper::cancelTouch(nsecs_t when) { void TouchInputMapper::cancelTouch(nsecs_t when) { abortPointerUsage(when, 0 /*policyFlags*/); abortPointerUsage(when, 0 /*policyFlags*/); abortTouches(when, 0 /* policyFlags*/); } } bool TouchInputMapper::isPointInsideSurface(int32_t x, int32_t y) { bool TouchInputMapper::isPointInsideSurface(int32_t x, int32_t y) { Loading
services/inputflinger/InputReader.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1364,6 +1364,9 @@ protected: // True if we sent a HOVER_ENTER event. // True if we sent a HOVER_ENTER event. bool mSentHoverEnter; bool mSentHoverEnter; // Is the current stream of direct touch events aborted bool mCurrentMotionAborted; // The time the primary pointer last went down. // The time the primary pointer last went down. nsecs_t mDownTime; nsecs_t mDownTime; Loading Loading @@ -1688,6 +1691,7 @@ private: void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage); void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage); void abortPointerUsage(nsecs_t when, uint32_t policyFlags); void abortPointerUsage(nsecs_t when, uint32_t policyFlags); void abortTouches(nsecs_t when, uint32_t policyFlags); void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout); void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout); void abortPointerGestures(nsecs_t when, uint32_t policyFlags); void abortPointerGestures(nsecs_t when, uint32_t policyFlags); Loading