summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2021-04-12 23:05:26 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-04-12 23:05:26 +0000
commit80c88126581a48e26b983bb95241598679e46a65 (patch)
tree91effbe4d1827cbe50d99ca5bf804e74a961a417 /libs/binder/ProcessState.cpp
parent1a6ecaf93130787421ca7936e5bb177232cb78d0 (diff)
parent3d4bed1669cdd1effc3b4864a269a986f62067c2 (diff)
Merge "libbinder use stronger refbase semantics" am: d5cc17b3b4 am: 374ef9f0eb am: 3d4bed1669
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1664341 Change-Id: Ia3d8cdf2e4664eb4b67a3e21161fdbd03af2c0a7
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index abb792eda0..7647a8c0df 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -105,7 +105,7 @@ sp<ProcessState> ProcessState::init(const char *driver, bool requireDefault)
}
std::lock_guard<std::mutex> l(gProcessMutex);
- gProcess = new ProcessState(driver);
+ gProcess = sp<ProcessState>::make(driver);
});
if (requireDefault) {
@@ -299,8 +299,8 @@ sp<IBinder> ProcessState::getStrongProxyForHandle(int32_t handle)
return nullptr;
}
- b = BpBinder::create(handle);
- e->binder = b;
+ sp<BpBinder> b = BpBinder::create(handle);
+ e->binder = b.get();
if (b) e->refs = b->getWeakRefs();
result = b;
} else {
@@ -340,7 +340,7 @@ void ProcessState::spawnPooledThread(bool isMain)
if (mThreadPoolStarted) {
String8 name = makeBinderThreadName();
ALOGV("Spawning new pooled thread, name=%s\n", name.string());
- sp<Thread> t = new PoolThread(isMain);
+ sp<Thread> t = sp<PoolThread>::make(isMain);
t->run(name.string());
}
}