Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb216a47 authored by Pablo Gamito's avatar Pablo Gamito Committed by Android (Google) Code Review
Browse files

Merge "Only run surface stats callbacks on transaction complete"

parents 1ed33cbb 10026473
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -352,6 +352,10 @@ void TransactionCompletedListener::onTransactionCompleted(ListenerStats listener
            // through all until the SC is found.
            int32_t layerId = -1;
            for (auto callbackId : transactionStats.callbackIds) {
                if (callbackId.type != CallbackId::Type::ON_COMPLETE) {
                    // We only want to run the stats callback for ON_COMPLETE
                    continue;
                }
                sp<SurfaceControl> sc =
                        callbacksMap[callbackId].surfaceControls[surfaceStats.surfaceControl];
                if (sc != nullptr) {
@@ -360,7 +364,7 @@ void TransactionCompletedListener::onTransactionCompleted(ListenerStats listener
                }
            }

            {
            if (layerId != -1) {
                // Acquire surface stats listener lock such that we guarantee that after calling
                // unregister, there won't be any further callback.
                std::scoped_lock<std::recursive_mutex> lock(mSurfaceStatsListenerMutex);