summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-03-27 03:13:27 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-03-27 03:13:27 +0000
commitd4f120917501406a84908b2d94d1603b2bf1eadd (patch)
treedb176d90585335e89d76dbded224cc6caf7e7d3d
parent70ad9e0d6c56bd97ea7197f085aa69647818f962 (diff)
parent2336ca0bbafba3544ab1f1a2ae9a04ce14b2ee24 (diff)
downloadsecurity-d4f120917501406a84908b2d94d1603b2bf1eadd.tar.gz
Snap for 5409551 from 2336ca0bbafba3544ab1f1a2ae9a04ce14b2ee24 to qt-release
Change-Id: I22abf83268d755ba97800b1e7d1b5b8044976f27
-rw-r--r--keystore/operation_proto_handler.cpp1
-rw-r--r--keystore/operation_proto_handler.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/keystore/operation_proto_handler.cpp b/keystore/operation_proto_handler.cpp
index 1833acb3..dfc06928 100644
--- a/keystore/operation_proto_handler.cpp
+++ b/keystore/operation_proto_handler.cpp
@@ -106,6 +106,7 @@ void checkOpCharacteristics(const hidl_vec<KeyParameter>& characteristics,
}
void OperationProtoHandler::uploadOpAsProto(Operation& op, bool wasOpSuccessful) {
+ std::lock_guard<std::mutex> lock(op_upload_mutex);
OperationConfig operationConfig;
determinePurpose(op.purpose, &operationConfig);
checkKeyCharacteristics(op.characteristics.softwareEnforced, &operationConfig);
diff --git a/keystore/operation_proto_handler.h b/keystore/operation_proto_handler.h
index 838f3ec4..64d0a594 100644
--- a/keystore/operation_proto_handler.h
+++ b/keystore/operation_proto_handler.h
@@ -20,6 +20,7 @@
#include "operation_config.pb.h"
#include "operation_struct.h"
#include <chrono>
+#include <mutex>
#include <unordered_map>
#include <vector>
@@ -35,6 +36,7 @@ class OperationProtoHandler {
private:
std::unordered_map<std::string, int> protoMap;
std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now();
+ std::mutex op_upload_mutex;
};
} // namespace keystore