diff options
author | 2025-02-19 10:00:04 -0800 | |
---|---|---|
committer | 2025-02-19 10:00:04 -0800 | |
commit | 328dea0588d956e3bb20635fc80d8d04f63169fa (patch) | |
tree | b06a695ae036b7f61764ab0e6b7823797d249b61 /libs/gui/SurfaceControl.cpp | |
parent | 7ad24b9b794b282aa25d28c42832fd50815f0816 (diff) | |
parent | 81793808b9347a52dd979e4b3d5d9d10fc8c4915 (diff) |
Merge "Harden construction sites of android::StrongPointer." into main
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
-rw-r--r-- | libs/gui/SurfaceControl.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index b735418d4b..ba2d80d1b3 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -269,10 +269,11 @@ status_t SurfaceControl::readFromParcel(const Parcel& parcel, SAFE_PARCEL(parcel.readUint32, &format); // We aren't the original owner of the surface. - *outSurfaceControl = new SurfaceControl(new SurfaceComposerClient( - interface_cast<ISurfaceComposerClient>(client)), - handle.get(), layerId, layerName, width, height, format, - transformHint); + *outSurfaceControl = + sp<SurfaceControl>::make(sp<SurfaceComposerClient>::make( + interface_cast<ISurfaceComposerClient>(client)), + handle, layerId, layerName, width, height, format, + transformHint); return NO_ERROR; } @@ -303,7 +304,7 @@ sp<SurfaceControl> SurfaceControl::getParentingLayer() { if (mBbqChild != nullptr) { return mBbqChild; } - return this; + return sp<SurfaceControl>::fromExisting(this); } uint64_t SurfaceControl::resolveFrameNumber(const std::optional<uint64_t>& frameNumber) { |