summaryrefslogtreecommitdiff
path: root/libs/binder/IServiceManager.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2021-04-02 02:52:46 +0000
committer Steven Moreland <smoreland@google.com> 2021-04-09 20:16:46 +0000
commit1a3a8effca802995ece193b7d40cd80abba55798 (patch)
tree6d4d56881d48e2067459e26eb8d6f61a11ac7197 /libs/binder/IServiceManager.cpp
parent64eff6c18215bf4c70ce8b56d2c1304157260bec (diff)
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
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r--libs/binder/IServiceManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index ca067e2d7f..61f4581df3 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -102,7 +102,7 @@ sp<IServiceManager> defaultServiceManager()
}
}
- gDefaultServiceManager = new ServiceManagerShim(sm);
+ gDefaultServiceManager = sp<ServiceManagerShim>::make(sm);
});
return gDefaultServiceManager;
@@ -324,7 +324,7 @@ sp<IBinder> ServiceManagerShim::waitForService(const String16& name16)
}
if (out != nullptr) return out;
- sp<Waiter> waiter = new Waiter;
+ sp<Waiter> waiter = sp<Waiter>::make();
if (!mTheRealServiceManager->registerForNotifications(
name, waiter).isOk()) {
return nullptr;