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.h b/services/inputflinger/dispatcher/InputEventTimeline.h
index 1756944..6668399 100644
--- a/services/inputflinger/dispatcher/InputEventTimeline.h
+++ b/services/inputflinger/dispatcher/InputEventTimeline.h
@@ -74,15 +74,39 @@
bool mHasGraphicsTimeline = false;
};
+enum class InputEventActionType : int32_t {
+ UNKNOWN_INPUT_EVENT = 0,
+ MOTION_ACTION_DOWN = 1,
+ // Motion events for ACTION_MOVE (characterizes scrolling motion)
+ MOTION_ACTION_MOVE = 2,
+ // Motion events for ACTION_UP (when the pointer first goes up)
+ MOTION_ACTION_UP = 3,
+ // Motion events for ACTION_HOVER_MOVE (pointer position on screen changes but pointer is not
+ // down)
+ MOTION_ACTION_HOVER_MOVE = 4,
+ // Motion events for ACTION_SCROLL (moving the mouse wheel)
+ MOTION_ACTION_SCROLL = 5,
+ // Key events for both ACTION_DOWN and ACTION_UP (key press and key release)
+ KEY = 6,
+
+ ftl_first = UNKNOWN_INPUT_EVENT,
+ ftl_last = KEY,
+ // Used by latency fuzzer
+ kMaxValue = ftl_last
+
+};
+
struct InputEventTimeline {
InputEventTimeline(bool isDown, nsecs_t eventTime, nsecs_t readTime, uint16_t vendorId,
- uint16_t productId, const std::set<InputDeviceUsageSource>& sources);
+ uint16_t productId, const std::set<InputDeviceUsageSource>& sources,
+ InputEventActionType inputEventActionType);
const bool isDown; // True if this is an ACTION_DOWN event
const nsecs_t eventTime;
const nsecs_t readTime;
const uint16_t vendorId;
const uint16_t productId;
const std::set<InputDeviceUsageSource> sources;
+ const InputEventActionType inputEventActionType;
struct IBinderHash {
std::size_t operator()(const sp<IBinder>& b) const {