Send correct downtime for motion events in split pointers case
Currently, for split pointer scenario, the down time is still the
the down time for the first pointer on the display. This might not
necessarily be the downTime for a window in split pointer case.
Need to send the correct downTime when we split pointers.
Test: atest inputflinger_tests
Bug: 228331266
Bug: 220109830
Change-Id: I80cf889e3243c39619ba96bd2b74073642cabc36
diff --git a/services/inputflinger/dispatcher/TouchedWindow.h b/services/inputflinger/dispatcher/TouchedWindow.h
index 83b52a4..0962d0c 100644
--- a/services/inputflinger/dispatcher/TouchedWindow.h
+++ b/services/inputflinger/dispatcher/TouchedWindow.h
@@ -31,6 +31,9 @@
int32_t targetFlags;
BitSet32 pointerIds; // zero unless target flag FLAG_SPLIT is set
bool isPilferingPointers = false;
+ // Time at which the first action down occurred on this window.
+ // NOTE: This is not initialized in case of HOVER entry/exit and DISPATCH_AS_OUTSIDE scenario.
+ std::optional<nsecs_t> firstDownTimeInTarget;
};
} // namespace inputdispatcher