Pass an apply token to BBQ

Allow BBQ to use a passed in apply token for applying transactions. This
allows us to order transactions when a BBQ is recreated by sharing
the same apply token between the BBQs.

Flag: EXEMPT bugfix
Test: presubmit
Fixes: 353332587
Change-Id: Icbadce96e9f72f13a26c4430cdfadf6ea315ce84
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 94998e5..c65eafa 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -1266,6 +1266,11 @@
     mTransactionHangCallback = std::move(callback);
 }
 
+void BLASTBufferQueue::setApplyToken(sp<IBinder> applyToken) {
+    std::lock_guard _lock{mMutex};
+    mApplyToken = std::move(applyToken);
+}
+
 #if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BUFFER_RELEASE_CHANNEL)
 
 BLASTBufferQueue::BufferReleaseReader::BufferReleaseReader(