diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-11-19 18:56:03 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-11-19 18:56:03 +0000 |
commit | ae225cf467b07e11832ad8b5bf7a850e49213595 (patch) | |
tree | 6cc4a6a2557fd74100795dde3d8c23a9fad29576 | |
parent | b0f5b51e2025294a5f1cd34de841c463fbf499fc (diff) | |
parent | 19e17f0981ab9b228e1685f9805d619c0249ba6e (diff) | |
download | security-q_tzdata_aml_295600110.tar.gz |
Snap for 6983956 from 19e17f0981ab9b228e1685f9805d619c0249ba6e to qt-aml-tzdata-releaseq_tzdata_aml_297100400q_tzdata_aml_297100300q_tzdata_aml_297100000q_tzdata_aml_296200000q_tzdata_aml_295600118q_tzdata_aml_295600110q_tzdata_aml_295500002q_tzdata_aml_295500001q_tzdata_aml_294400310android-mainline-12.0.0_r54android-mainline-12.0.0_r111android-mainline-10.0.0_r13android-mainline-10.0.0_r12q_tzdata_aml_297100000android12-mainline-tzdata-releaseandroid10-mainline-tzdata-releaseandroid10-android13-mainline-tzdata-release
Change-Id: I1525e8879e8ecd7cf047ce868ae638a53807c132
-rw-r--r-- | keystore/keystore_keymaster_enforcement.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/keystore/keystore_keymaster_enforcement.h b/keystore/keystore_keymaster_enforcement.h index e7515a1f..b0dae48e 100644 --- a/keystore/keystore_keymaster_enforcement.h +++ b/keystore/keystore_keymaster_enforcement.h @@ -86,16 +86,19 @@ class KeystoreKeymasterEnforcement : public KeymasterEnforcement { } bool is_device_locked(int32_t userId) const override { + std::lock_guard<std::mutex> lock(is_device_locked_for_user_map_lock_); // If we haven't had a set call for this user yet, assume the device is locked. if (mIsDeviceLockedForUser.count(userId) == 0) return true; return mIsDeviceLockedForUser.find(userId)->second; } void set_device_locked(bool isLocked, int32_t userId) { + std::lock_guard<std::mutex> lock(is_device_locked_for_user_map_lock_); mIsDeviceLockedForUser[userId] = isLocked; } private: + mutable std::mutex is_device_locked_for_user_map_lock_; std::map<int32_t, bool> mIsDeviceLockedForUser; }; |