Pass RawEvent latency from InputReader to InputListener

To keep track of the lower-level latency like touch driver latency, keep
track of the time when eventhub reads the events.

This information will be stored inside RawEvent as it is being read.

Next, this information will be passed to the InputListener. The InputListener will
report this data to LatencyTracker, which will aggregate this
information in order to get end-to-end touch latency.

Different mappers process the input_event events differently. So a
mapper-specific approach is used here.

Bug: 169866723
Test: atest inputflinger_tests
Change-Id: I5e4e90b3251351327022c467af99a6d84f82164e
diff --git a/services/inputflinger/reader/include/EventHub.h b/services/inputflinger/reader/include/EventHub.h
index 30967df..13364e0 100644
--- a/services/inputflinger/reader/include/EventHub.h
+++ b/services/inputflinger/reader/include/EventHub.h
@@ -51,7 +51,11 @@
  * A raw event as retrieved from the EventHub.
  */
 struct RawEvent {
+    // Time when the event happened
     nsecs_t when;
+    // Time when the event was read by EventHub. Only populated for input events.
+    // For other events (device added/removed/etc), this value is undefined and should not be read.
+    nsecs_t readTime;
     int32_t deviceId;
     int32_t type;
     int32_t code;