Loading services/inputflinger/UnwantedInteractionBlocker.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -368,14 +368,6 @@ void UnwantedInteractionBlocker::notifyKey(const NotifyKeyArgs* args) { } void UnwantedInteractionBlocker::notifyMotion(const NotifyMotionArgs* args) { ftl::StaticVector<NotifyMotionArgs, 2> processedArgs = mPreferStylusOverTouchBlocker.processMotion(*args); for (const NotifyMotionArgs& loopArgs : processedArgs) { notifyMotionInner(&loopArgs); } } void UnwantedInteractionBlocker::notifyMotionInner(const NotifyMotionArgs* args) { auto it = mPalmRejectors.find(args->deviceId); const bool sendToPalmRejector = it != mPalmRejectors.end() && isFromTouchscreen(args->source); if (!sendToPalmRejector) { Loading Loading @@ -449,8 +441,6 @@ void UnwantedInteractionBlocker::notifyInputDevicesChanged( void UnwantedInteractionBlocker::dump(std::string& dump) { dump += "UnwantedInteractionBlocker:\n"; dump += " mPreferStylusOverTouchBlocker:\n"; dump += addPrefix(mPreferStylusOverTouchBlocker.dump(), " "); dump += StringPrintf(" mEnablePalmRejection: %s\n", toString(mEnablePalmRejection)); dump += StringPrintf(" isPalmRejectionEnabled (flag value): %s\n", toString(isPalmRejectionEnabled())); Loading services/inputflinger/UnwantedInteractionBlocker.h +0 −6 Original line number Diff line number Diff line Loading @@ -23,8 +23,6 @@ #include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util.h" #include "ui/events/ozone/evdev/touch_filter/palm_detection_filter.h" #include "PreferStylusOverTouchBlocker.h" namespace android { // --- Functions for manipulation of event streams Loading Loading @@ -90,13 +88,9 @@ private: InputListenerInterface& mListener; const bool mEnablePalmRejection; // When stylus is down, ignore touch PreferStylusOverTouchBlocker mPreferStylusOverTouchBlocker; // Detect and reject unwanted palms on screen // Use a separate palm rejector for every touch device. std::map<int32_t /*deviceId*/, PalmRejector> mPalmRejectors; // TODO(b/210159205): delete this when simultaneous stylus and touch is supported void notifyMotionInner(const NotifyMotionArgs* args); }; class SlotState { Loading services/inputflinger/tests/UnwantedInteractionBlocker_test.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -490,6 +490,14 @@ TEST_F(UnwantedInteractionBlockerTest, NoCrashWhenResetHappens) { &(args = generateMotionArgs(0 /*downTime*/, 4 /*eventTime*/, DOWN, {{7, 8, 9}}))); } TEST_F(UnwantedInteractionBlockerTest, NoCrashWhenStylusSourceWithFingerToolIsReceived) { mBlocker->notifyInputDevicesChanged({generateTestDeviceInfo()}); NotifyMotionArgs args = generateMotionArgs(0 /*downTime*/, 1 /*eventTime*/, DOWN, {{1, 2, 3}}); args.pointerProperties[0].toolType = AMOTION_EVENT_TOOL_TYPE_FINGER; args.source = AINPUT_SOURCE_STYLUS; mBlocker->notifyMotion(&args); } /** * If input devices have changed, but the important device info that's used by the * UnwantedInteractionBlocker has not changed, there should not be a reset. Loading Loading
services/inputflinger/UnwantedInteractionBlocker.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -368,14 +368,6 @@ void UnwantedInteractionBlocker::notifyKey(const NotifyKeyArgs* args) { } void UnwantedInteractionBlocker::notifyMotion(const NotifyMotionArgs* args) { ftl::StaticVector<NotifyMotionArgs, 2> processedArgs = mPreferStylusOverTouchBlocker.processMotion(*args); for (const NotifyMotionArgs& loopArgs : processedArgs) { notifyMotionInner(&loopArgs); } } void UnwantedInteractionBlocker::notifyMotionInner(const NotifyMotionArgs* args) { auto it = mPalmRejectors.find(args->deviceId); const bool sendToPalmRejector = it != mPalmRejectors.end() && isFromTouchscreen(args->source); if (!sendToPalmRejector) { Loading Loading @@ -449,8 +441,6 @@ void UnwantedInteractionBlocker::notifyInputDevicesChanged( void UnwantedInteractionBlocker::dump(std::string& dump) { dump += "UnwantedInteractionBlocker:\n"; dump += " mPreferStylusOverTouchBlocker:\n"; dump += addPrefix(mPreferStylusOverTouchBlocker.dump(), " "); dump += StringPrintf(" mEnablePalmRejection: %s\n", toString(mEnablePalmRejection)); dump += StringPrintf(" isPalmRejectionEnabled (flag value): %s\n", toString(isPalmRejectionEnabled())); Loading
services/inputflinger/UnwantedInteractionBlocker.h +0 −6 Original line number Diff line number Diff line Loading @@ -23,8 +23,6 @@ #include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util.h" #include "ui/events/ozone/evdev/touch_filter/palm_detection_filter.h" #include "PreferStylusOverTouchBlocker.h" namespace android { // --- Functions for manipulation of event streams Loading Loading @@ -90,13 +88,9 @@ private: InputListenerInterface& mListener; const bool mEnablePalmRejection; // When stylus is down, ignore touch PreferStylusOverTouchBlocker mPreferStylusOverTouchBlocker; // Detect and reject unwanted palms on screen // Use a separate palm rejector for every touch device. std::map<int32_t /*deviceId*/, PalmRejector> mPalmRejectors; // TODO(b/210159205): delete this when simultaneous stylus and touch is supported void notifyMotionInner(const NotifyMotionArgs* args); }; class SlotState { Loading
services/inputflinger/tests/UnwantedInteractionBlocker_test.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -490,6 +490,14 @@ TEST_F(UnwantedInteractionBlockerTest, NoCrashWhenResetHappens) { &(args = generateMotionArgs(0 /*downTime*/, 4 /*eventTime*/, DOWN, {{7, 8, 9}}))); } TEST_F(UnwantedInteractionBlockerTest, NoCrashWhenStylusSourceWithFingerToolIsReceived) { mBlocker->notifyInputDevicesChanged({generateTestDeviceInfo()}); NotifyMotionArgs args = generateMotionArgs(0 /*downTime*/, 1 /*eventTime*/, DOWN, {{1, 2, 3}}); args.pointerProperties[0].toolType = AMOTION_EVENT_TOOL_TYPE_FINGER; args.source = AINPUT_SOURCE_STYLUS; mBlocker->notifyMotion(&args); } /** * If input devices have changed, but the important device info that's used by the * UnwantedInteractionBlocker has not changed, there should not be a reset. Loading