From ea52d3c543d30354e9fe1cc351cf8f562e44f061 Mon Sep 17 00:00:00 2001 From: Sungtak Lee Date: Mon, 16 Sep 2024 16:55:04 +0000 Subject: Add missing IProducerListener callbacks to BLASTBufferQueue Add IProducerListener::onBufferDetached and IProducerListener::onBufferAttached to BLASTBufferQueue. Bug: 353202582 Flag: com.android.graphics.libgui.flags.bq_consumer_attach_callback Test: build (cherry picked from https://android-review.googlesource.com/q/commit:7c935090e839ec3391c6f94d46a2367e59a46056) Merged-In: I53f25354804bd777ce20410edebe8e7d6a213061 Change-Id: I53f25354804bd777ce20410edebe8e7d6a213061 --- libs/gui/BLASTBufferQueue.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/gui/BLASTBufferQueue.cpp') diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index 739c3c2a41..044170c378 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -1096,6 +1096,17 @@ public: AsyncWorker::getInstance().post( [listener = mListener, slots = slots]() { listener->onBuffersDiscarded(slots); }); } + + void onBufferDetached(int slot) override { + AsyncWorker::getInstance().post( + [listener = mListener, slot = slot]() { listener->onBufferDetached(slot); }); + } + +#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_CONSUMER_ATTACH_CALLBACK) + void onBufferAttached() override { + AsyncWorker::getInstance().post([listener = mListener]() { listener->onBufferAttached(); }); + } +#endif }; // Extends the BufferQueueProducer to create a wrapper around the listener so the listener calls -- cgit v1.2.3-59-g8ed1b