summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/TransactionCompletedThread.cpp
diff options
context:
space:
mode:
author Valerie Hau <vhau@google.com> 2019-11-19 14:13:16 -0800
committer Valerie Hau <vhau@google.com> 2019-11-19 14:55:35 -0800
commitac12ae73c2a2cc7d4fedcc1e187ff9984679df54 (patch)
tree4c811ec4e0ffcc2c98dc8899dc22c0f60e902032 /services/surfaceflinger/TransactionCompletedThread.cpp
parent1c2a53e618eff6ed831f6c70196389c02a27c6dd (diff)
Clear all pending transactions on screen wakeup
If an app sets a transaction that modifies layer state, but does not get committed by an SF composition cycle, we may end up dangling some callbacks. Temporary fix is to clear and send callbacks on wakeup Bug: 141111965 Test: build, boot, manual Change-Id: I781124c3f96174cefd5eb67e597c13f923df4fc1
Diffstat (limited to 'services/surfaceflinger/TransactionCompletedThread.cpp')
-rw-r--r--services/surfaceflinger/TransactionCompletedThread.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/surfaceflinger/TransactionCompletedThread.cpp b/services/surfaceflinger/TransactionCompletedThread.cpp
index 8db03db7e8..c15355d338 100644
--- a/services/surfaceflinger/TransactionCompletedThread.cpp
+++ b/services/surfaceflinger/TransactionCompletedThread.cpp
@@ -189,6 +189,15 @@ status_t TransactionCompletedThread::finalizePendingCallbackHandles(
return NO_ERROR;
}
+void TransactionCompletedThread::clearAllPending() {
+ std::lock_guard lock(mMutex);
+ if (!mRunning) {
+ return;
+ }
+ mPendingTransactions.clear();
+ mConditionVariable.notify_all();
+}
+
status_t TransactionCompletedThread::registerUnpresentedCallbackHandle(
const sp<CallbackHandle>& handle) {
std::lock_guard lock(mMutex);