summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/TransactionCompletedThread.cpp
diff options
context:
space:
mode:
author Valerie Hau <vhau@google.com> 2020-06-18 17:00:58 -0700
committer Valerie Hau <vhau@google.com> 2020-06-19 10:50:49 -0700
commit109ad7156997f031717183664ac51a03110bc2b3 (patch)
tree80332a2a284cadb57785146a1d057e61eaf7115f /services/surfaceflinger/TransactionCompletedThread.cpp
parent09397229e38cfca397c38904a58ef1a3f6cbcf85 (diff)
Only force send callbacks if they are registered
Some clients of ASurfaceControl may not set callbacks. We do not want to call finalizePendingCallbacks in this case. Bug: 159231312 Test: build, boot, SurfaceFlinger_test, libsurfaceflinger_unittest Change-Id: I62dc270302a60274d8d1192d0e35ce3f48721e6c
Diffstat (limited to 'services/surfaceflinger/TransactionCompletedThread.cpp')
-rw-r--r--services/surfaceflinger/TransactionCompletedThread.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/surfaceflinger/TransactionCompletedThread.cpp b/services/surfaceflinger/TransactionCompletedThread.cpp
index 0cdff8f380..ca244934e4 100644
--- a/services/surfaceflinger/TransactionCompletedThread.cpp
+++ b/services/surfaceflinger/TransactionCompletedThread.cpp
@@ -154,6 +154,9 @@ status_t TransactionCompletedThread::registerPendingCallbackHandle(
status_t TransactionCompletedThread::finalizePendingCallbackHandles(
const std::deque<sp<CallbackHandle>>& handles) {
+ if (handles.empty()) {
+ return NO_ERROR;
+ }
std::lock_guard lock(mMutex);
if (!mRunning) {
ALOGE("cannot add presented callback handle because the callback thread isn't running");