Loading libs/input/input_flags.aconfig +7 −0 Original line number Original line Diff line number Diff line Loading @@ -27,3 +27,10 @@ flag { description: "Set to true to enable timer support for the touchpad Gestures library" description: "Set to true to enable timer support for the touchpad Gestures library" bug: "297192727" bug: "297192727" } } flag { name: "enable_multi_device_input" namespace: "input" description: "Set to true to enable multi-device input: touch and stylus can be active at the same time, but in different windows" bug: "211379801" } services/inputflinger/UnwantedInteractionBlocker.cpp +11 −4 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include "UnwantedInteractionBlocker.h" #include "UnwantedInteractionBlocker.h" #include <android-base/stringprintf.h> #include <android-base/stringprintf.h> #include <com_android_input_flags.h> #include <ftl/enum.h> #include <ftl/enum.h> #include <input/PrintTools.h> #include <input/PrintTools.h> #include <inttypes.h> #include <inttypes.h> Loading @@ -28,6 +29,8 @@ #include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.h" #include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.h" #include "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h" #include "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h" namespace input_flags = com::android::input::flags; using android::base::StringPrintf; using android::base::StringPrintf; /** /** Loading Loading @@ -344,11 +347,15 @@ void UnwantedInteractionBlocker::notifyMotion(const NotifyMotionArgs& args) { ALOGD_IF(DEBUG_INBOUND_MOTION, "%s: %s", __func__, args.dump().c_str()); ALOGD_IF(DEBUG_INBOUND_MOTION, "%s: %s", __func__, args.dump().c_str()); { // acquire lock { // acquire lock std::scoped_lock lock(mLock); std::scoped_lock lock(mLock); if (input_flags::enable_multi_device_input()) { notifyMotionLocked(args); } else { const std::vector<NotifyMotionArgs> processedArgs = const std::vector<NotifyMotionArgs> processedArgs = mPreferStylusOverTouchBlocker.processMotion(args); mPreferStylusOverTouchBlocker.processMotion(args); for (const NotifyMotionArgs& loopArgs : processedArgs) { for (const NotifyMotionArgs& loopArgs : processedArgs) { notifyMotionLocked(loopArgs); notifyMotionLocked(loopArgs); } } } } // release lock } // release lock // Call out to the next stage without holding the lock // Call out to the next stage without holding the lock Loading Loading
libs/input/input_flags.aconfig +7 −0 Original line number Original line Diff line number Diff line Loading @@ -27,3 +27,10 @@ flag { description: "Set to true to enable timer support for the touchpad Gestures library" description: "Set to true to enable timer support for the touchpad Gestures library" bug: "297192727" bug: "297192727" } } flag { name: "enable_multi_device_input" namespace: "input" description: "Set to true to enable multi-device input: touch and stylus can be active at the same time, but in different windows" bug: "211379801" }
services/inputflinger/UnwantedInteractionBlocker.cpp +11 −4 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include "UnwantedInteractionBlocker.h" #include "UnwantedInteractionBlocker.h" #include <android-base/stringprintf.h> #include <android-base/stringprintf.h> #include <com_android_input_flags.h> #include <ftl/enum.h> #include <ftl/enum.h> #include <input/PrintTools.h> #include <input/PrintTools.h> #include <inttypes.h> #include <inttypes.h> Loading @@ -28,6 +29,8 @@ #include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.h" #include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.h" #include "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h" #include "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h" namespace input_flags = com::android::input::flags; using android::base::StringPrintf; using android::base::StringPrintf; /** /** Loading Loading @@ -344,11 +347,15 @@ void UnwantedInteractionBlocker::notifyMotion(const NotifyMotionArgs& args) { ALOGD_IF(DEBUG_INBOUND_MOTION, "%s: %s", __func__, args.dump().c_str()); ALOGD_IF(DEBUG_INBOUND_MOTION, "%s: %s", __func__, args.dump().c_str()); { // acquire lock { // acquire lock std::scoped_lock lock(mLock); std::scoped_lock lock(mLock); if (input_flags::enable_multi_device_input()) { notifyMotionLocked(args); } else { const std::vector<NotifyMotionArgs> processedArgs = const std::vector<NotifyMotionArgs> processedArgs = mPreferStylusOverTouchBlocker.processMotion(args); mPreferStylusOverTouchBlocker.processMotion(args); for (const NotifyMotionArgs& loopArgs : processedArgs) { for (const NotifyMotionArgs& loopArgs : processedArgs) { notifyMotionLocked(loopArgs); notifyMotionLocked(loopArgs); } } } } // release lock } // release lock // Call out to the next stage without holding the lock // Call out to the next stage without holding the lock Loading