Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcf3fc08 authored by David Drysdale's avatar David Drysdale
Browse files

KeyMint: don't mix Binder and std shared pointers

Bug: 203871378
Test: VtsAidlKeyMintTargetTest, TreeHugger
Change-Id: I8671342939af2bbdef643be9ce81b0bb9e7ae1a9
parent 6a58c592
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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());