[ANativeWindow] add ANativeWindow_getNextFrameId api.
Stable API for getNextFrameNumber. Here the naming is mirroring the
existing EGL api for eglGetNextFrameIdANDROID.
Bug: 137012798
Test: builds
Change-Id: I8bf6fb198055a295b8aa68d3b9db2577376d39b1
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index 2caffca..a1c9eb8 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -331,3 +331,7 @@
void ANativeWindow_allocateBuffers(ANativeWindow* window) {
window->perform(window, NATIVE_WINDOW_ALLOCATE_BUFFERS);
}
+
+int64_t ANativeWindow_getNextFrameId(ANativeWindow* window) {
+ return query64(window, NATIVE_WINDOW_GET_NEXT_FRAME_ID);
+}
diff --git a/libs/nativewindow/include/apex/window.h b/libs/nativewindow/include/apex/window.h
index 3dec011..02b886c 100644
--- a/libs/nativewindow/include/apex/window.h
+++ b/libs/nativewindow/include/apex/window.h
@@ -212,4 +212,11 @@
*/
void ANativeWindow_allocateBuffers(ANativeWindow* window);
+/**
+ * Retrieves an identifier for the next frame to be queued by this window.
+ *
+ * \return -errno on error, otherwise returns the next frame id.
+ */
+int64_t ANativeWindow_getNextFrameId(ANativeWindow* window);
+
__END_DECLS
diff --git a/libs/nativewindow/libnativewindow.map.txt b/libs/nativewindow/libnativewindow.map.txt
index 427f317..e0e20c3 100644
--- a/libs/nativewindow/libnativewindow.map.txt
+++ b/libs/nativewindow/libnativewindow.map.txt
@@ -26,6 +26,7 @@
ANativeWindow_getLastDequeueDuration; # apex # introduced=30
ANativeWindow_getLastDequeueStartTime; # apex # introduced=30
ANativeWindow_getLastQueueDuration; # apex # introduced=30
+ ANativeWindow_getNextFrameId; # apex # introduced=30
ANativeWindow_getWidth;
ANativeWindow_lock;
ANativeWindow_query; # llndk