summaryrefslogtreecommitdiff
path: root/core/java/android/view/InputEventReceiver.java
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2021-02-26 00:15:04 +0000
committerSiarhei Vishniakou <svv@google.com>2021-03-05 21:42:32 +0000
commitf0cf18d3ed1c993cfd70bafc6867782d80cc24cc (patch)
tree99d87e66cfad4485f9eea001d4f87e5c5590e239 /core/java/android/view/InputEventReceiver.java
parent7102d06f9e912a89960459a58d82bd4821a65a4c (diff)
Pass actual present time to ViewRootImpl
To measure end-to-end touch latency, we need to report the actual present time to ViewRootImpl. ViewRootImpl, in turn, will report this information to InputDispatcher. Finally, InputDispatcher will combine all known information for a specific input event, and will report this data to westworld. In another patch, we will add a new call, 'reportLatencyInfo', to InputPublisher. This call will allow the app to send this latency data to InputDispatcher. Bug: 169866723 Test: printed the input event present times inside ViewRootImpl Change-Id: Ibd3a2cfeb1a340eb15cd2165071df1f8589634af
Diffstat (limited to 'core/java/android/view/InputEventReceiver.java')
-rw-r--r--core/java/android/view/InputEventReceiver.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/InputEventReceiver.java b/core/java/android/view/InputEventReceiver.java
index 7d1adc36964b..79d8c14aa0df 100644
--- a/core/java/android/view/InputEventReceiver.java
+++ b/core/java/android/view/InputEventReceiver.java
@@ -21,6 +21,7 @@ import android.os.Build;
import android.os.IBinder;
import android.os.Looper;
import android.os.MessageQueue;
+import android.os.Trace;
import android.util.Log;
import android.util.SparseIntArray;
@@ -198,6 +199,15 @@ public abstract class InputEventReceiver {
}
/**
+ * Report the latency information for a specific input event.
+ */
+ public final void reportLatencyInfo(int inputEventId, long gpuCompletedTime, long presentTime) {
+ Trace.traceBegin(Trace.TRACE_TAG_INPUT, "reportLatencyInfo");
+ // TODO(b/169866723) : send this data to InputDispatcher via InputChannel
+ Trace.traceEnd(Trace.TRACE_TAG_INPUT);
+ }
+
+ /**
* Consumes all pending batched input events.
* Must be called on the same Looper thread to which the receiver is attached.
*