InputTracer: Don't make WindowDispatchArgs an inner class
For consistency with other structs and definitions in the backend
interface, move WindowDispatchArgs outside of the interface class.
Bug: 210460522
Test: atest inputflinger_tests
Change-Id: I9fe98448bace259faa40b082981211fdf9b1e221
diff --git a/services/inputflinger/tests/FakeInputTracingBackend.cpp b/services/inputflinger/tests/FakeInputTracingBackend.cpp
index dc74f84..069b50d 100644
--- a/services/inputflinger/tests/FakeInputTracingBackend.cpp
+++ b/services/inputflinger/tests/FakeInputTracingBackend.cpp
@@ -37,10 +37,9 @@
return std::visit([](const auto& event) { return event.id; }, v);
}
-MotionEvent toInputEvent(
- const trace::TracedMotionEvent& e,
- const trace::InputTracingBackendInterface::WindowDispatchArgs& dispatchArgs,
- const std::array<uint8_t, 32>& hmac) {
+MotionEvent toInputEvent(const trace::TracedMotionEvent& e,
+ const trace::WindowDispatchArgs& dispatchArgs,
+ const std::array<uint8_t, 32>& hmac) {
MotionEvent traced;
traced.initialize(e.id, e.deviceId, e.source, e.displayId, hmac, e.action, e.actionButton,
dispatchArgs.resolvedFlags, e.edgeFlags, e.metaState, e.buttonState,
@@ -51,8 +50,7 @@
return traced;
}
-KeyEvent toInputEvent(const trace::TracedKeyEvent& e,
- const trace::InputTracingBackendInterface::WindowDispatchArgs& dispatchArgs,
+KeyEvent toInputEvent(const trace::TracedKeyEvent& e, const trace::WindowDispatchArgs& dispatchArgs,
const std::array<uint8_t, 32>& hmac) {
KeyEvent traced;
traced.initialize(e.id, e.deviceId, e.source, e.displayId, hmac, e.action,
@@ -120,7 +118,7 @@
auto tracedDispatchesIt =
std::find_if(mTracedWindowDispatches.begin(), mTracedWindowDispatches.end(),
- [&](const WindowDispatchArgs& args) {
+ [&](const trace::WindowDispatchArgs& args) {
return args.windowId == expectedWindowId &&
getId(args.eventEntry) == expectedEvent.getId();
});
@@ -181,7 +179,7 @@
mTrace->mEventTracedCondition.notify_all();
}
-void FakeInputTracingBackend::traceWindowDispatch(const WindowDispatchArgs& args,
+void FakeInputTracingBackend::traceWindowDispatch(const trace::WindowDispatchArgs& args,
const trace::TracedEventArgs&) {
{
std::scoped_lock lock(mTrace->mLock);
diff --git a/services/inputflinger/tests/FakeInputTracingBackend.h b/services/inputflinger/tests/FakeInputTracingBackend.h
index b149ffe..ab05d6b 100644
--- a/services/inputflinger/tests/FakeInputTracingBackend.h
+++ b/services/inputflinger/tests/FakeInputTracingBackend.h
@@ -59,8 +59,7 @@
std::mutex mLock;
std::condition_variable mEventTracedCondition;
std::unordered_map<uint32_t /*eventId*/, trace::TracedEvent> mTracedEvents GUARDED_BY(mLock);
- using WindowDispatchArgs = trace::InputTracingBackendInterface::WindowDispatchArgs;
- std::vector<WindowDispatchArgs> mTracedWindowDispatches GUARDED_BY(mLock);
+ std::vector<trace::WindowDispatchArgs> mTracedWindowDispatches GUARDED_BY(mLock);
std::vector<std::pair<std::variant<KeyEvent, MotionEvent>, int32_t /*windowId*/>>
mExpectedEvents GUARDED_BY(mLock);
@@ -86,7 +85,7 @@
void traceKeyEvent(const trace::TracedKeyEvent& entry, const trace::TracedEventArgs&) override;
void traceMotionEvent(const trace::TracedMotionEvent& entry,
const trace::TracedEventArgs&) override;
- void traceWindowDispatch(const WindowDispatchArgs& entry,
+ void traceWindowDispatch(const trace::WindowDispatchArgs& entry,
const trace::TracedEventArgs&) override;
};