From 1a3a8effca802995ece193b7d40cd80abba55798 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 2 Apr 2021 02:52:46 +0000 Subject: libbinder use stronger refbase semantics As a larger example of how to use ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION. Bug: 184190315 Test: boot (relevant tests in TEST_MAPPING) Change-Id: I88283543e1f63fd1010f9cd3f63baefec84e6a84 --- libs/binder/ProcessState.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/binder/ProcessState.cpp') diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index 82f6faf7a1..a8b2fb2ff8 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -105,7 +105,7 @@ sp ProcessState::init(const char *driver, bool requireDefault) } std::lock_guard l(gProcessMutex); - gProcess = new ProcessState(driver); + gProcess = sp::make(driver); }); if (requireDefault) { @@ -299,8 +299,8 @@ sp ProcessState::getStrongProxyForHandle(int32_t handle) return nullptr; } - b = BpBinder::create(handle); - e->binder = b; + sp 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 t = new PoolThread(isMain); + sp t = sp::make(isMain); t->run(name.string()); } } -- cgit v1.2.3-59-g8ed1b