Move Choreographer to libgui.
For Attached Choreographer, we want to store, access, and set attributes
on a Choreographer from the SurfaceControl it is attached to.
SurfaceControl is in libgui, so move Choreographer from libnativedisplay
into libgui as well.
The Android.bp dep chain: libandroid includes< libhwui <
libnativedisplay < libgui
Bug: 255838011
Test: atest ChoreographerNativeTest (no regression)
Test: make and flash
Test: presubmit
Change-Id: Ie9f8cac93a888127ffa48d7061a467649e0ca694
diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp
index a988e39..6c9c28a 100644
--- a/libs/gui/Android.bp
+++ b/libs/gui/Android.bp
@@ -192,6 +192,7 @@
"BitTube.cpp",
"BLASTBufferQueue.cpp",
"BufferItemConsumer.cpp",
+ "Choreographer.cpp",
"CompositorTiming.cpp",
"ConsumerBase.cpp",
"CpuConsumer.cpp",
@@ -234,6 +235,7 @@
export_header_lib_headers: [
"libgui_aidl_headers",
+ "jni_headers",
],
aidl: {
@@ -241,6 +243,7 @@
},
header_libs: [
+ "jni_headers",
"libdvr_headers",
"libgui_aidl_headers",
"libpdx_headers",
diff --git a/libs/nativedisplay/Choreographer.cpp b/libs/gui/Choreographer.cpp
similarity index 99%
rename from libs/nativedisplay/Choreographer.cpp
rename to libs/gui/Choreographer.cpp
index 01e9f04..6b25b26 100644
--- a/libs/nativedisplay/Choreographer.cpp
+++ b/libs/gui/Choreographer.cpp
@@ -16,8 +16,8 @@
// #define LOG_NDEBUG 0
+#include <gui/Choreographer.h>
#include <jni.h>
-#include <nativedisplay/Choreographer.h>
#undef LOG_TAG
#define LOG_TAG "AChoreographer"
diff --git a/libs/nativedisplay/include/nativedisplay/Choreographer.h b/libs/gui/include/gui/Choreographer.h
similarity index 98%
rename from libs/nativedisplay/include/nativedisplay/Choreographer.h
rename to libs/gui/include/gui/Choreographer.h
index bb63f29..89a7058 100644
--- a/libs/nativedisplay/include/nativedisplay/Choreographer.h
+++ b/libs/gui/include/gui/Choreographer.h
@@ -16,8 +16,9 @@
#pragma once
+#include <android/choreographer.h>
#include <gui/DisplayEventDispatcher.h>
-#include <private/android/choreographer.h>
+#include <jni.h>
#include <utils/Looper.h>
#include <mutex>
diff --git a/libs/nativedisplay/AChoreographer.cpp b/libs/nativedisplay/AChoreographer.cpp
index e64165f..66a40f1 100644
--- a/libs/nativedisplay/AChoreographer.cpp
+++ b/libs/nativedisplay/AChoreographer.cpp
@@ -16,8 +16,8 @@
#include <android-base/thread_annotations.h>
#include <android/gui/ISurfaceComposer.h>
+#include <gui/Choreographer.h>
#include <jni.h>
-#include <nativedisplay/Choreographer.h>
#include <private/android/choreographer.h>
#include <utils/Looper.h>
#include <utils/Timers.h>
diff --git a/libs/nativedisplay/Android.bp b/libs/nativedisplay/Android.bp
index 70de33d..8d8a2bc 100644
--- a/libs/nativedisplay/Android.bp
+++ b/libs/nativedisplay/Android.bp
@@ -56,7 +56,6 @@
":libgui_frame_event_aidl",
"AChoreographer.cpp",
"ADisplay.cpp",
- "Choreographer.cpp",
"surfacetexture/surface_texture.cpp",
"surfacetexture/SurfaceTexture.cpp",
"surfacetexture/ImageConsumer.cpp",