summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ng/AndroidKeyMintDevice.cpp4
-rw-r--r--ng/include/AndroidKeyMintDevice.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/ng/AndroidKeyMintDevice.cpp b/ng/AndroidKeyMintDevice.cpp
index 373ec03..9d2cc69 100644
--- a/ng/AndroidKeyMintDevice.cpp
+++ b/ng/AndroidKeyMintDevice.cpp
@@ -492,8 +492,8 @@ ScopedAStatus AndroidKeyMintDevice::sendRootOfTrust(const vector<uint8_t>& /* ro
return kmError2ScopedAStatus(KM_ERROR_UNIMPLEMENTED);
}
-IKeyMintDevice* CreateKeyMintDevice(SecurityLevel securityLevel) {
- return ::new AndroidKeyMintDevice(securityLevel);
+std::shared_ptr<IKeyMintDevice> CreateKeyMintDevice(SecurityLevel securityLevel) {
+ return ndk::SharedRefBase::make<AndroidKeyMintDevice>(securityLevel);
}
} // namespace aidl::android::hardware::security::keymint
diff --git a/ng/include/AndroidKeyMintDevice.h b/ng/include/AndroidKeyMintDevice.h
index b1b27cb..06557be 100644
--- a/ng/include/AndroidKeyMintDevice.h
+++ b/ng/include/AndroidKeyMintDevice.h
@@ -94,6 +94,6 @@ class AndroidKeyMintDevice : public BnKeyMintDevice {
SecurityLevel securityLevel_;
};
-IKeyMintDevice* CreateKeyMintDevice(SecurityLevel securityLevel);
+std::shared_ptr<IKeyMintDevice> CreateKeyMintDevice(SecurityLevel securityLevel);
} // namespace aidl::android::hardware::security::keymint