diff options
| author | 2020-01-03 16:53:39 -0800 | |
|---|---|---|
| committer | 2020-01-06 10:34:44 -0800 | |
| commit | 236eba34ccbc3bdbe381f34148d2b283feb90b29 (patch) | |
| tree | 10e2a8bf76f52a021418a59aae7d92961cd5cac8 /libs/gui/SurfaceComposerClient.cpp | |
| parent | a81d409ce10bc25bd8b3e28f8ef87376d5fa2b5b (diff) | |
Fix callback registration during merging in same-process
Bug: 147109531
Test: build, boot, libsurfaceflinger_unittest, SurfaceFlinger_test
Change-Id: I17d9ba98ba85d45b3325588e94e978747786488c
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 1d887ea931..f378fc5ef6 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -484,14 +484,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr mListenerCallbacks[listener].callbackIds.insert(std::make_move_iterator( callbackIds.begin()), std::make_move_iterator(callbackIds.end())); - // register surface controls for this listener that is merging - for (const auto& surfaceControl : surfaceControls) { - registerSurfaceControlForCallback(surfaceControl); - } - mListenerCallbacks[listener] - .surfaceControls.insert(std::make_move_iterator(surfaceControls.begin()), - std::make_move_iterator(surfaceControls.end())); + mListenerCallbacks[listener].surfaceControls.insert(surfaceControls.begin(), + surfaceControls.end()); + + auto& currentProcessCallbackInfo = + mListenerCallbacks[TransactionCompletedListener::getIInstance()]; + currentProcessCallbackInfo.surfaceControls + .insert(std::make_move_iterator(surfaceControls.begin()), + std::make_move_iterator(surfaceControls.end())); + + // register all surface controls for all callbackIds for this listener that is merging + for (const auto& surfaceControl : currentProcessCallbackInfo.surfaceControls) { + TransactionCompletedListener::getInstance() + ->addSurfaceControlToCallbacks(surfaceControl, + currentProcessCallbackInfo.callbackIds); + } } mInputWindowCommands.merge(other.mInputWindowCommands); |