summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/TransactionCallbackInvoker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/TransactionCallbackInvoker.cpp')
-rw-r--r--services/surfaceflinger/TransactionCallbackInvoker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/surfaceflinger/TransactionCallbackInvoker.cpp b/services/surfaceflinger/TransactionCallbackInvoker.cpp
index fa8cffc32a..d2c2e29a2f 100644
--- a/services/surfaceflinger/TransactionCallbackInvoker.cpp
+++ b/services/surfaceflinger/TransactionCallbackInvoker.cpp
@@ -185,6 +185,7 @@ void TransactionCallbackInvoker::addPresentFence(const sp<Fence>& presentFence)
void TransactionCallbackInvoker::sendCallbacks(bool onCommitOnly) {
// For each listener
auto completedTransactionsItr = mCompletedTransactions.begin();
+ BackgroundExecutor::Callbacks callbacks;
while (completedTransactionsItr != mCompletedTransactions.end()) {
auto& [listener, transactionStatsDeque] = *completedTransactionsItr;
ListenerStats listenerStats;
@@ -219,7 +220,7 @@ void TransactionCallbackInvoker::sendCallbacks(bool onCommitOnly) {
// keep it as an IBinder due to consistency reasons: if we
// interface_cast at the IPC boundary when reading a Parcel,
// we get pointers that compare unequal in the SF process.
- BackgroundExecutor::getInstance().execute([stats = std::move(listenerStats)]() {
+ callbacks.emplace_back([stats = std::move(listenerStats)]() {
interface_cast<ITransactionCompletedListener>(stats.listener)
->onTransactionCompleted(stats);
});
@@ -231,6 +232,8 @@ void TransactionCallbackInvoker::sendCallbacks(bool onCommitOnly) {
if (mPresentFence) {
mPresentFence.clear();
}
+
+ BackgroundExecutor::getInstance().sendCallbacks(std::move(callbacks));
}
// -----------------------------------------------------------------------