diff options
| author | 2019-06-13 09:44:42 -0700 | |
|---|---|---|
| committer | 2019-06-13 09:44:42 -0700 | |
| commit | 68f8c55d6f2c2bbea0b6f6fd67fd974cc06edcaa (patch) | |
| tree | 26e10b42ed2b85bd3cf7f01a54cfc867c662f519 | |
| parent | f011ae373a4b60c6ac483bcbcf095d183e977608 (diff) | |
| parent | 2f3b6776871df035e182b450af0c94435eb4571e (diff) | |
Merge "TransactionCallbacks: don't send callbacks until applied" into qt-dev
am: 2f3b677687
Change-Id: I83099808f25dd15d1e43ba0ba9c4e90c364c4640
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 9 |
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(); |