libui: Add GraphicBufferMapper::unlock shims

* Commit Ib4590b7a3b839a993f6c747c5f09a6312f7ab329 modified
  GraphicBufferMapper::unlock overload. Create a shim to provide the old
  symbol for blobs that need it

Change-Id: I0e90ac0b383b05904df83076d990ad9335a40664
This commit is contained in:
Giovanni Ricca 2024-06-16 17:00:16 +02:00
parent 5206a0f0a5
commit c69c85fcad
No known key found for this signature in database
2 changed files with 14 additions and 0 deletions

View file

@ -396,6 +396,7 @@ cc_library_shared {
name: "libui_shim", name: "libui_shim",
shared_libs: [ shared_libs: [
"libui", "libui",
"libsync",
"libutils", "libutils",
], ],
srcs: [ srcs: [

View file

@ -5,6 +5,7 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include <sync/sync.h>
#include <ui/GraphicBufferMapper.h> #include <ui/GraphicBufferMapper.h>
#include <ui/Rect.h> #include <ui/Rect.h>
#include <utils/Errors.h> #include <utils/Errors.h>
@ -19,4 +20,16 @@ status_t _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPvP
auto* gpm = static_cast<android::GraphicBufferMapper*>(thisptr); auto* gpm = static_cast<android::GraphicBufferMapper*>(thisptr);
return gpm->lock(handle, usage, bounds, vaddr); return gpm->lock(handle, usage, bounds, vaddr);
} }
status_t _ZN7android19GraphicBufferMapper6unlockEPK13native_handle(void* thisptr,
buffer_handle_t handle) {
android::base::unique_fd outFence;
auto* gpm = static_cast<android::GraphicBufferMapper*>(thisptr);
status_t status = gpm->unlock(handle, &outFence);
if (status == android::OK && outFence.get() >= 0) {
sync_wait(outFence.get(), -1);
outFence.reset();
}
return status;
}
} }