Revert^2 "Harden construction sites of android::StrongPointer."
This reverts commit f73db7a6242e297ead71df0d0d1fb3a8515245d3.
Reason for revert: Scope restricted to sp<>::make which is a safe
replacement for assignment from new.
Bug: 393217449
Test: ChoreographerTests pass locally.
Flag: EXEMPT_refactor
Change-Id: I9a38c54c06cc64da099d282c05ccf20f40b70a72
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index b735418..1eb9b87 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -269,10 +269,11 @@
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;
}