Adding an InputEventActionType enum field to InputEventTimeline.
This is needed for the Per Device Input Latency metrics which will be implemented, because we would
like to filter the data per input event action type. This enum corresponds to the InputEventType
enum field that will be added to the InputEventLatency atom.
InputEventTimeline already had a bool field isDown that was true only if the Motion Event was an
ACTION_DOWN, so we were dividing the latency values into two categories: DOWN vs other types of
events. The isDown field is still needed for the InputEventLatencySketch atom, but should be
deprecated with this atom once the new atom is recording data.
Bug: b/270049345
Test: atest inputflinger_tests
Flag: EXEMPT bugfix
Change-Id: Iabccb7217820d4ed070378d8f4d8f0410a2efbdf
diff --git a/services/inputflinger/dispatcher/InputEventTimeline.cpp b/services/inputflinger/dispatcher/InputEventTimeline.cpp
index a365003..31ceb8d 100644
--- a/services/inputflinger/dispatcher/InputEventTimeline.cpp
+++ b/services/inputflinger/dispatcher/InputEventTimeline.cpp
@@ -68,13 +68,15 @@
InputEventTimeline::InputEventTimeline(bool isDown, nsecs_t eventTime, nsecs_t readTime,
uint16_t vendorId, uint16_t productId,
- const std::set<InputDeviceUsageSource>& sources)
+ const std::set<InputDeviceUsageSource>& sources,
+ InputEventActionType inputEventActionType)
: isDown(isDown),
eventTime(eventTime),
readTime(readTime),
vendorId(vendorId),
productId(productId),
- sources(sources) {}
+ sources(sources),
+ inputEventActionType(inputEventActionType) {}
bool InputEventTimeline::operator==(const InputEventTimeline& rhs) const {
if (connectionTimelines.size() != rhs.connectionTimelines.size()) {
@@ -90,7 +92,8 @@
}
}
return isDown == rhs.isDown && eventTime == rhs.eventTime && readTime == rhs.readTime &&
- vendorId == rhs.vendorId && productId == rhs.productId && sources == rhs.sources;
+ vendorId == rhs.vendorId && productId == rhs.productId && sources == rhs.sources &&
+ inputEventActionType == rhs.inputEventActionType;
}
} // namespace android::inputdispatcher