summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Marissa Wall <marissaw@google.com> 2019-06-13 09:44:42 -0700
committer android-build-merger <android-build-merger@google.com> 2019-06-13 09:44:42 -0700
commit68f8c55d6f2c2bbea0b6f6fd67fd974cc06edcaa (patch)
tree26e10b42ed2b85bd3cf7f01a54cfc867c662f519
parentf011ae373a4b60c6ac483bcbcf095d183e977608 (diff)
parent2f3b6776871df035e182b450af0c94435eb4571e (diff)
Merge "TransactionCallbacks: don't send callbacks until applied" into qt-dev
am: 2f3b677687 Change-Id: I83099808f25dd15d1e43ba0ba9c4e90c364c4640
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index dd75868443..e795ba123a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2133,7 +2133,14 @@ void SurfaceFlinger::postComposition()
}
mTransactionCompletedThread.addPresentFence(mPreviousPresentFences[0]);
- mTransactionCompletedThread.sendCallbacks();
+
+ // Lock the mStateLock in case SurfaceFlinger is in the middle of applying a transaction.
+ // If we do not lock here, a callback could be sent without all of its SurfaceControls and
+ // metrics.
+ {
+ Mutex::Autolock _l(mStateLock);
+ mTransactionCompletedThread.sendCallbacks();
+ }
if (mLumaSampling && mRegionSamplingThread) {
mRegionSamplingThread->notifyNewContent();