Manage DropBoxManager using sp<>
DropBoxManager inherits from RefBase and should be managed using sp<>.
Not doing so will cause it to be reported after go/aog/674370 is
committed. We eventually plan to cause such uses to fail.
Bug: 79434190
Test: Build and boot master
Merged-In: Ibadfaac78f8c79b81a2bb0ee64972554bdec2178
Change-Id: Ibadfaac78f8c79b81a2bb0ee64972554bdec2178
diff --git a/keystore/operation_proto_handler.cpp b/keystore/operation_proto_handler.cpp
index 77e1b73..992232d 100644
--- a/keystore/operation_proto_handler.cpp
+++ b/keystore/operation_proto_handler.cpp
@@ -23,6 +23,7 @@
#include <keystore/keymaster_types.h>
#include <keystore/keystore_hidl_support.h>
#include <utils/String16.h>
+#include <utils/StrongPointer.h>
#include "operation_config.pb.h"
@@ -108,7 +109,7 @@
checkKeyCharacteristics(op.characteristics.softwareEnforced, &operationConfig);
checkKeyCharacteristics(op.characteristics.hardwareEnforced, &operationConfig);
checkOpCharacteristics(op.params, &operationConfig);
- auto dropbox = std::make_unique<android::os::DropBoxManager>();
+ android::sp<android::os::DropBoxManager> dropbox(new android::os::DropBoxManager);
operationConfig.set_was_op_successful(wasOpSuccessful);
size_t size = operationConfig.ByteSize();