diff --git a/libshims/libshim_ui/Android.bp b/libshims/libshim_ui/Android.bp index c0ac3c0..33c0dc5 100644 --- a/libshims/libshim_ui/Android.bp +++ b/libshims/libshim_ui/Android.bp @@ -8,6 +8,7 @@ cc_library_shared { name: "libshim_ui", shared_libs: [ "libui", + "libsync", "libutils", ], srcs: [ diff --git a/libshims/libshim_ui/GraphicBufferMapper.cpp b/libshims/libshim_ui/GraphicBufferMapper.cpp index a3ceffb..23b2c9c 100644 --- a/libshims/libshim_ui/GraphicBufferMapper.cpp +++ b/libshims/libshim_ui/GraphicBufferMapper.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -19,4 +20,16 @@ status_t _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPvP auto* gpm = static_cast(thisptr); 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(thisptr); + status_t status = gpm->unlock(handle, &outFence); + if (status == android::OK && outFence.get() >= 0) { + sync_wait(outFence.get(), -1); + outFence.reset(); + } + return status; +} }