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
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index de3f9cc..852885b 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -123,7 +123,7 @@
explicit DeathObserver(ComposerService& mgr) : mComposerService(mgr) { }
};
- mDeathObserver = sp<DeathObserver>::make(*const_cast<ComposerService*>(this));
+ mDeathObserver = new DeathObserver(*const_cast<ComposerService*>(this));
IInterface::asBinder(mComposerService)->linkToDeath(mDeathObserver);
return true;
}
@@ -170,7 +170,7 @@
explicit DeathObserver(ComposerServiceAIDL& mgr) : mComposerService(mgr) {}
};
- mDeathObserver = sp<DeathObserver>::make(*const_cast<ComposerServiceAIDL*>(this));
+ mDeathObserver = new DeathObserver(*const_cast<ComposerServiceAIDL*>(this));
IInterface::asBinder(mComposerService)->linkToDeath(mDeathObserver);
return true;
}
@@ -202,7 +202,7 @@
DefaultComposerClient& dc = DefaultComposerClient::getInstance();
Mutex::Autolock _l(dc.mLock);
if (dc.mClient == nullptr) {
- dc.mClient = sp<SurfaceComposerClient>::make();
+ dc.mClient = new SurfaceComposerClient;
}
return dc.mClient;
}
@@ -399,7 +399,7 @@
sp<TransactionCompletedListener> TransactionCompletedListener::getInstance() {
std::lock_guard<std::mutex> lock(sListenerInstanceMutex);
if (sInstance == nullptr) {
- sInstance = sp<TransactionCompletedListener>::make();
+ sInstance = new TransactionCompletedListener;
}
return sInstance;
}
@@ -677,7 +677,7 @@
SurfaceComposerClient::PresentationCallbackRAII::PresentationCallbackRAII(
TransactionCompletedListener* tcl, int id) {
- mTcl = sp<TransactionCompletedListener>::fromExisting(tcl);
+ mTcl = tcl;
mId = id;
}
@@ -691,7 +691,7 @@
std::scoped_lock<std::mutex> lock(mMutex);
mTrustedPresentationCallbacks[id] =
std::tuple<TrustedPresentationCallback, void*>(tpc, context);
- return sp<SurfaceComposerClient::PresentationCallbackRAII>::make(this, id);
+ return new SurfaceComposerClient::PresentationCallbackRAII(this, id);
}
void TransactionCompletedListener::clearTrustedPresentationCallback(int id) {
@@ -743,7 +743,7 @@
*/
class BufferCache : public Singleton<BufferCache> {
public:
- BufferCache() : token(sp<BBinder>::make()) {}
+ BufferCache() : token(new BBinder()) {}
sp<IBinder> getToken() {
return IInterface::asBinder(TransactionCompletedListener::getIInstance());
@@ -1357,7 +1357,7 @@
return binderStatus;
}
-sp<IBinder> SurfaceComposerClient::Transaction::sApplyToken = sp<BBinder>::make();
+sp<IBinder> SurfaceComposerClient::Transaction::sApplyToken = new BBinder();
std::mutex SurfaceComposerClient::Transaction::sApplyTokenMutex;
@@ -2695,10 +2695,9 @@
}
ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err));
if (err == NO_ERROR) {
- *outSurface = sp<SurfaceControl>::make(sp<SurfaceComposerClient>::fromExisting(this),
- result.handle, result.layerId,
- toString(result.layerName), w, h, format,
- result.transformHint, flags);
+ *outSurface = new SurfaceControl(this, result.handle, result.layerId,
+ toString(result.layerName), w, h, format,
+ result.transformHint, flags);
}
}
return err;
@@ -2714,8 +2713,7 @@
const binder::Status status = mClient->mirrorSurface(mirrorFromHandle, &result);
const status_t err = statusTFromBinderStatus(status);
if (err == NO_ERROR) {
- return sp<SurfaceControl>::make(sp<SurfaceComposerClient>::fromExisting(this),
- result.handle, result.layerId, toString(result.layerName));
+ return new SurfaceControl(this, result.handle, result.layerId, toString(result.layerName));
}
return nullptr;
}
@@ -2725,8 +2723,7 @@
const binder::Status status = mClient->mirrorDisplay(displayId.value, &result);
const status_t err = statusTFromBinderStatus(status);
if (err == NO_ERROR) {
- return sp<SurfaceControl>::make(sp<SurfaceComposerClient>::fromExisting(this),
- result.handle, result.layerId, toString(result.layerName));
+ return new SurfaceControl(this, result.handle, result.layerId, toString(result.layerName));
}
return nullptr;
}