diff options
| author | 2020-10-26 17:50:12 -0700 | |
|---|---|---|
| committer | 2020-10-26 17:56:31 -0700 | |
| commit | 47dbd69f85fdc57d414c3c31e6fd950fd473e387 (patch) | |
| tree | 3bd71f0349b90b71d54ae9132ebf835b47e12aa7 | |
| parent | 46f8f78fc9b4c6d1ed03dca43770b9f9d19784fd (diff) | |
Don't lose transaction callbacks that are still in the drawing state.
When a message invalidate occurs, the current state will be copied into
drawing state. If another invalide occurs before a refresh, the new
current state will be copied into the drawing state. That means we
would lose any transaction callbacks that were sent with the first
transaction. When refresh is called, we will not notify the callbacks
from the first transaction and the system will get stuck waiting for
callbacks forever.
Test: No direct steps to reproduce. Open apps a lot with blast and
make sure system doesn't freeze.
Change-Id: I820027e86b15e082e5e7092b2ee52e90a2328d38
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 50707dfe16..f657a00065 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1034,6 +1034,12 @@ uint32_t Layer::doTransaction(uint32_t flags) { mCurrentState.inputInfoChanged = false; } + // Add the callbacks from the drawing state into the current state. This is so when the current + // state gets copied to drawing, we don't lose the callback handles that are still in drawing. + for (auto& handle : s.callbackHandles) { + c.callbackHandles.push_back(handle); + } + // Commit the transaction commitTransaction(c); mPendingStatesSnapshot = mPendingStates; |