diff options
author | 2020-02-11 17:27:38 -0800 | |
---|---|---|
committer | 2020-02-12 01:45:30 +0000 | |
commit | 3248ea00de2c2c593d557ad6760bcfe9e5c2a96d (patch) | |
tree | 2f85938a41b5d993ca70417ed7aa89e297cb51c8 | |
parent | 3847d8b581ab7f07c656a8442b285ed81997fd49 (diff) |
Define out the hwbinder death notifier code for libgui
This code is only needed for the NO_BINDER version of
libgui (libgui_bufferqueue_static). For libgui, the notifier
is linked inside the connect/disconnect call of BufferQueue
itself.
bug: 149345887
test: Android Auto team helped test it on Auto devices to fix the bug.
Change-Id: I29ab83b9119729e3b878ace439086e87d9c585f6
-rw-r--r-- | libs/gui/bufferqueue/2.0/B2HGraphicBufferProducer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/gui/bufferqueue/2.0/B2HGraphicBufferProducer.cpp b/libs/gui/bufferqueue/2.0/B2HGraphicBufferProducer.cpp index 0f3ae2e28c..c76d771262 100644 --- a/libs/gui/bufferqueue/2.0/B2HGraphicBufferProducer.cpp +++ b/libs/gui/bufferqueue/2.0/B2HGraphicBufferProducer.cpp @@ -288,10 +288,12 @@ Return<void> B2HGraphicBufferProducer::connect( &bOutput), &hStatus) && b2h(bOutput, &hOutput); - if (converted) { +#ifdef NO_BINDER + if (converted && hListener != nullptr) { mObituary = new Obituary(this, hListener, hConnectionType); hListener->linkToDeath(mObituary, 0); } +#endif // NO_BINDER _hidl_cb(converted ? hStatus : HStatus::UNKNOWN_ERROR, hOutput); return {}; } @@ -304,10 +306,12 @@ Return<HStatus> B2HGraphicBufferProducer::disconnect( } HStatus hStatus{}; bool converted = b2h(mBase->disconnect(bConnectionType), &hStatus); +#ifdef NO_BINDER if (mObituary != nullptr) { mObituary->listener->unlinkToDeath(mObituary); mObituary.clear(); } +#endif // NO_BINDER return {converted ? hStatus : HStatus::UNKNOWN_ERROR}; } |