diff options
| author | 2024-03-05 16:27:56 +0000 | |
|---|---|---|
| committer | 2024-03-05 22:25:09 +0000 | |
| commit | 2b2d1bf66ae1fdc5f2db3d9fadf916ccb22d4a7b (patch) | |
| tree | b8c6a8deca708cb36be75725e15819d850bdaf15 | |
| parent | eaa9fde906b02a87155f54963eb659b6a70830ae (diff) | |
InputTracer: Trace injected events with history as separate events
If an injected event is batched, it is split into separate events and
each historical event is injected individually. When this happens, the
historical events were not being traced, which is a bug. Trace them.
It is difficult to test batching from InputDispatcher_tests because we
are polling for events rather than responding to them, so avoid adding a
test for now.
Bug: 210460522
Test: atest inputflinger_tests
Change-Id: I7062f97181bcde614e43e68e127583690efa70b2
| -rw-r--r-- | services/inputflinger/dispatcher/InputDispatcher.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 057b996a23..1725e48f7f 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp @@ -4815,6 +4815,10 @@ InputEventInjectionResult InputDispatcher::injectInputEvent(const InputEvent* ev pointerCount)); transformMotionEntryForInjectionLocked(*nextInjectedEntry, motionEvent.getTransform()); + if (mTracer) { + nextInjectedEntry->traceTracker = + mTracer->traceInboundEvent(*nextInjectedEntry); + } injectedEntries.push(std::move(nextInjectedEntry)); } break; |