diff options
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 2466d2555a..4c8cab24b6 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -543,9 +543,14 @@ SurfaceComposerClient::SurfaceComposerClient(const sp<IGraphicBufferProducer>& r { } +SurfaceComposerClient::SurfaceComposerClient(const sp<ISurfaceComposerClient>& client) + : mStatus(NO_ERROR), mClient(client) +{ +} + void SurfaceComposerClient::onFirstRef() { sp<ISurfaceComposer> sf(ComposerService::getComposerService()); - if (sf != 0) { + if (sf != 0 && mStatus == NO_INIT) { auto rootProducer = mParent.promote(); sp<ISurfaceComposerClient> conn; conn = (rootProducer != nullptr) ? sf->createScopedConnection(rootProducer) : |