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
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp
index 1c6b491..f3ea1a7 100644
--- a/libs/binder/AppOpsManager.cpp
+++ b/libs/binder/AppOpsManager.cpp
@@ -36,7 +36,7 @@
pthread_mutex_lock(&gClientIdMutex);
if (gClientId == nullptr) {
- gClientId = new BBinder();
+ gClientId = sp<BBinder>::make();
}
pthread_mutex_unlock(&gClientIdMutex);
return gClientId;