Fix sideband stream issues
- Notify a listener when sideband stream is set
- Mark a layer as visible when sideband stream is set, even though
no buffer is queued.
Change-Id: I9652bf530f2b5ce331533ec1bb3b10a815ca191c
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 9dd90ba..249b7c7 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -793,8 +793,16 @@
}
status_t BufferQueueProducer::setSidebandStream(const sp<NativeHandle>& stream) {
- Mutex::Autolock _l(mCore->mMutex);
- mCore->mSidebandStream = stream;
+ sp<IConsumerListener> listener;
+ { // Autolock scope
+ Mutex::Autolock _l(mCore->mMutex);
+ mCore->mSidebandStream = stream;
+ listener = mCore->mConsumerListener;
+ } // Autolock scope
+
+ if (listener != NULL) {
+ listener->onSidebandStreamChanged();
+ }
return NO_ERROR;
}