summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueProducer.cpp
diff options
context:
space:
mode:
author Priyanka Advani (xWF) <padvani@google.com> 2025-02-19 17:35:16 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-19 17:35:16 -0800
commitf73db7a6242e297ead71df0d0d1fb3a8515245d3 (patch)
treed8b75648a2c39694a22e13dec94ac10344ca11ec /libs/gui/BufferQueueProducer.cpp
parent81793808b9347a52dd979e4b3d5d9d10fc8c4915 (diff)
Revert "Harden construction sites of android::StrongPointer."
This reverts commit 81793808b9347a52dd979e4b3d5d9d10fc8c4915. Reason for revert: Droidmonitor created revert due to b/397788382. Will be verifying through ABTD before submission. Change-Id: Idd58b82a5a5380053cdff4e7b92eafa66b2c2782
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
-rw-r--r--libs/gui/BufferQueueProducer.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 54b3a1f08c..c241482827 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -693,11 +693,11 @@ status_t BufferQueueProducer::dequeueBuffer(int* outSlot, sp<android::Fence>* ou
.requestorName = {mConsumerName.c_str(), mConsumerName.size()},
.extras = std::move(tempOptions),
};
- sp<GraphicBuffer> graphicBuffer = sp<GraphicBuffer>::make(allocRequest);
+ sp<GraphicBuffer> graphicBuffer = new GraphicBuffer(allocRequest);
#else
sp<GraphicBuffer> graphicBuffer =
- sp<GraphicBuffer>::make(width, height, format, BQ_LAYER_COUNT, usage,
- std::string{mConsumerName.c_str(), mConsumerName.size()});
+ new GraphicBuffer(width, height, format, BQ_LAYER_COUNT, usage,
+ {mConsumerName.c_str(), mConsumerName.size()});
#endif
status_t error = graphicBuffer->initCheck();
@@ -1464,7 +1464,7 @@ status_t BufferQueueProducer::connect(const sp<IProducerListener>& listener,
#ifndef NO_BINDER
if (IInterface::asBinder(listener)->remoteBinder() != nullptr) {
status = IInterface::asBinder(listener)->linkToDeath(
- sp<IBinder::DeathRecipient>::fromExisting(this));
+ static_cast<IBinder::DeathRecipient*>(this));
if (status != NO_ERROR) {
BQ_LOGE("connect: linkToDeath failed: %s (%d)",
strerror(-status), status);
@@ -1553,7 +1553,8 @@ status_t BufferQueueProducer::disconnect(int api, DisconnectMode mode) {
IInterface::asBinder(mCore->mLinkedToDeath);
// This can fail if we're here because of the death
// notification, but we just ignore it
- token->unlinkToDeath(sp<IBinder::DeathRecipient>::fromExisting(this));
+ token->unlinkToDeath(
+ static_cast<IBinder::DeathRecipient*>(this));
}
#endif
mCore->mSharedBufferSlot =
@@ -1684,11 +1685,11 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height,
#endif
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_EXTENDEDALLOCATE)
- sp<GraphicBuffer> graphicBuffer = sp<GraphicBuffer>::make(allocRequest);
+ sp<GraphicBuffer> graphicBuffer = new GraphicBuffer(allocRequest);
#else
- sp<GraphicBuffer> graphicBuffer =
- sp<GraphicBuffer>::make(allocWidth, allocHeight, allocFormat, BQ_LAYER_COUNT,
- allocUsage, allocName);
+ sp<GraphicBuffer> graphicBuffer = new GraphicBuffer(
+ allocWidth, allocHeight, allocFormat, BQ_LAYER_COUNT,
+ allocUsage, allocName);
#endif
status_t result = graphicBuffer->initCheck();