Move LatencyStatistics collection from InputReader to InputTransport

This move allows us to grab a bigger context of how much time a motion
event is spent from the kernel to right before the event was published.

Test: Modified LatencyStats to report ever 10 seconds. Utilized logs to
check that logs were reporting every 10 seconds. Checked also using
logs that data was being added and calculated correctly.

Change-Id: Iee0f9a2155e93ae77de5a5cd8b9fd1506186c60f
Signed-off-by: Atif Niyaz <atifniyaz@google.com>
diff --git a/include/input/InputTransport.h b/include/input/InputTransport.h
index df23f61..690e0a1 100644
--- a/include/input/InputTransport.h
+++ b/include/input/InputTransport.h
@@ -31,13 +31,16 @@
 
 #include <string>
 
+#include <android-base/chrono_utils.h>
+
 #include <binder/IBinder.h>
 #include <input/Input.h>
-#include <utils/Errors.h>
-#include <utils/Timers.h>
-#include <utils/RefBase.h>
-#include <utils/Vector.h>
+#include <input/LatencyStatistics.h>
 #include <utils/BitSet.h>
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <utils/Timers.h>
+#include <utils/Vector.h>
 
 namespace android {
 class Parcel;
@@ -286,7 +289,12 @@
     status_t receiveFinishedSignal(uint32_t* outSeq, bool* outHandled);
 
 private:
+    static constexpr std::chrono::duration TOUCH_STATS_REPORT_PERIOD = 5min;
+
     sp<InputChannel> mChannel;
+    LatencyStatistics mTouchStatistics{TOUCH_STATS_REPORT_PERIOD};
+
+    void reportTouchEventForStatistics(nsecs_t evdevTime);
 };
 
 /*