From f0cf18d3ed1c993cfd70bafc6867782d80cc24cc Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Fri, 26 Feb 2021 00:15:04 +0000 Subject: 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 --- graphics/java/android/graphics/HardwareRendererObserver.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/java/android') 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); } -- cgit v1.2.3-59-g8ed1b