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
This commit is contained in:
Valerie Hau 2020-06-18 17:00:58 -07:00
parent 09397229e3
commit 109ad71569

View file

@ -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");