Notify InputListener when there an changes to input devices
There are now more than one input listener stages that need to know when
the devices change. Notify listeners directly instead of routing it
through the policy.
Bug: 275726706
Test: atest inputflinger_tests
Change-Id: I37019f8069bad3bbc585805f792beb514faa8cb1
diff --git a/services/inputflinger/UnwantedInteractionBlocker.cpp b/services/inputflinger/UnwantedInteractionBlocker.cpp
index ae20f86..6d43e8d 100644
--- a/services/inputflinger/UnwantedInteractionBlocker.cpp
+++ b/services/inputflinger/UnwantedInteractionBlocker.cpp
@@ -411,6 +411,13 @@
}
void UnwantedInteractionBlocker::notifyInputDevicesChanged(
+ const NotifyInputDevicesChangedArgs& args) {
+ onInputDevicesChanged(args.inputDeviceInfos);
+ mQueuedListener.notify(args);
+ mQueuedListener.flush();
+}
+
+void UnwantedInteractionBlocker::onInputDevicesChanged(
const std::vector<InputDeviceInfo>& inputDevices) {
std::scoped_lock lock(mLock);
if (!mEnablePalmRejection) {