Merge "KeyMint: don't mix Binder and std shared pointers"

This commit is contained in:
David Drysdale 2021-11-01 06:35:12 +00:00 committed by Gerrit Code Review
commit a86af7c9b1

View file

@ -31,7 +31,7 @@ using aidl::android::hardware::security::sharedsecret::trusty::TrustySharedSecre
template <typename T, class... Args>
std::shared_ptr<T> addService(Args&&... args) {
std::shared_ptr<T> service = std::make_shared<T>(std::forward<Args>(args)...);
std::shared_ptr<T> service = ndk::SharedRefBase::make<T>(std::forward<Args>(args)...);
auto instanceName = std::string(T::descriptor) + "/default";
LOG(ERROR) << "Adding service instance: " << instanceName;
auto status = AServiceManager_addService(service->asBinder().get(), instanceName.c_str());