summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2021-02-26 00:15:04 +0000
committer Siarhei Vishniakou <svv@google.com> 2021-03-05 21:42:32 +0000
commitf0cf18d3ed1c993cfd70bafc6867782d80cc24cc (patch)
tree99d87e66cfad4485f9eea001d4f87e5c5590e239 /graphics/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 'graphics/java')
-rw-r--r--graphics/java/android/graphics/HardwareRendererObserver.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/java/android/graphics/HardwareRendererObserver.java b/graphics/java/android/graphics/HardwareRendererObserver.java
index da9d03c639f7..e2a05723166f 100644
--- a/graphics/java/android/graphics/HardwareRendererObserver.java
+++ b/graphics/java/android/graphics/HardwareRendererObserver.java
@@ -62,7 +62,7 @@ public class HardwareRendererObserver {
* @param handler the Handler to use when invoking callbacks
*/
public HardwareRendererObserver(@NonNull OnFrameMetricsAvailableListener listener,
- @NonNull long[] frameMetrics, @NonNull Handler handler) {
+ @NonNull long[] frameMetrics, @NonNull Handler handler, boolean waitForPresentTime) {
if (handler == null || handler.getLooper() == null) {
throw new NullPointerException("handler and its looper cannot be null");
}
@@ -74,7 +74,7 @@ public class HardwareRendererObserver {
mFrameMetrics = frameMetrics;
mHandler = handler;
mListener = listener;
- mNativePtr = new VirtualRefBasePtr(nCreateObserver());
+ mNativePtr = new VirtualRefBasePtr(nCreateObserver(waitForPresentTime));
}
/*package*/ long getNativeInstance() {
@@ -98,6 +98,6 @@ public class HardwareRendererObserver {
});
}
- private native long nCreateObserver();
+ private native long nCreateObserver(boolean waitForPresentTime);
private static native int nGetNextBuffer(long nativePtr, long[] data);
}