diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index 314bf29101554..7a18bd5ae9622 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -225,6 +225,7 @@ LIBANDROID { AStorageManager_unmountObb; ASurfaceControl_create; # introduced=29 ASurfaceControl_createFromWindow; # introduced=29 + ASurfaceControl_acquire; # introduced=31 ASurfaceControl_release; # introduced=29 ASurfaceTexture_acquireANativeWindow; # introduced=28 ASurfaceTexture_attachToGLContext; # introduced=28 diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index 189be800e0189..c1b5f1ddd4233 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -185,10 +185,16 @@ ASurfaceControl* ASurfaceControl_create(ASurfaceControl* parent, const char* deb return reinterpret_cast(surfaceControl.get()); } -void ASurfaceControl_release(ASurfaceControl* aSurfaceControl) { - sp surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl); +void ASurfaceControl_acquire(ASurfaceControl* aSurfaceControl) { + SurfaceControl* surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl); - SurfaceControl_release(surfaceControl.get()); + SurfaceControl_acquire(surfaceControl); +} + +void ASurfaceControl_release(ASurfaceControl* aSurfaceControl) { + SurfaceControl* surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl); + + SurfaceControl_release(surfaceControl); } ASurfaceTransaction* ASurfaceTransaction_create() {