From e3da4bbc9c7e0f07a7241ee937c39f1007a9a449 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Wed, 5 Apr 2023 23:51:23 +0000 Subject: 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 --- services/inputflinger/NotifyArgs.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'services/inputflinger/NotifyArgs.cpp') diff --git a/services/inputflinger/NotifyArgs.cpp b/services/inputflinger/NotifyArgs.cpp index 5f2a22f467..408fbed99e 100644 --- a/services/inputflinger/NotifyArgs.cpp +++ b/services/inputflinger/NotifyArgs.cpp @@ -29,6 +29,12 @@ using android::base::StringPrintf; namespace android { +// --- NotifyInputDevicesChangedArgs --- + +NotifyInputDevicesChangedArgs::NotifyInputDevicesChangedArgs(int32_t id, + std::vector infos) + : id(id), inputDeviceInfos(std::move(infos)) {} + // --- NotifyConfigurationChangedArgs --- NotifyConfigurationChangedArgs::NotifyConfigurationChangedArgs(int32_t id, nsecs_t eventTime) @@ -234,6 +240,7 @@ Visitor(V...) -> Visitor; const char* toString(const NotifyArgs& args) { Visitor toStringVisitor{ + [&](const NotifyInputDevicesChangedArgs&) { return "NotifyInputDevicesChangedArgs"; }, [&](const NotifyConfigurationChangedArgs&) { return "NotifyConfigurationChangedArgs"; }, [&](const NotifyKeyArgs&) { return "NotifyKeyArgs"; }, [&](const NotifyMotionArgs&) { return "NotifyMotionArgs"; }, -- cgit v1.2.3-59-g8ed1b