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

Commit 10026473 authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Only run surface stats callbacks on transaction complete

Test: atest CtsWindowManagerDeviceTestCases:FrameMetricsTests

Bug: 206956036
Change-Id: If31c4a6e2f391d8fd8e47a01d94653db584a5430
parent 20ca6625
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);