diff options
author | Xin Li <delphij@google.com> | 2017-11-14 12:08:38 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2017-11-14 12:08:38 -0800 |
commit | bb9e38fef95b7bc932ebcad18508e03228f9f7d3 (patch) | |
tree | 29e859e08879c87f591507de0f370abd1ec66fe2 /biometrics | |
parent | b86b2d2881d53219c59a5eb85a3d73cb45942661 (diff) | |
parent | 1a06284b24f5eb7bb9c1fea0817da8898b3b1bff (diff) | |
download | platform_hardware_interfaces-bb9e38fef95b7bc932ebcad18508e03228f9f7d3.tar.gz platform_hardware_interfaces-bb9e38fef95b7bc932ebcad18508e03228f9f7d3.tar.bz2 platform_hardware_interfaces-bb9e38fef95b7bc932ebcad18508e03228f9f7d3.zip |
Merge commit '1a06284b24f5eb7bb9c1fea0817da8898b3b1bff' from
oc-mr1-dev-plus-aosp into stage-aosp-master
Change-Id: I2a044eb8c9981d0a8198ffe2df55559afbd76341
Merged-In: I4fb9f18884f7ef21162015a0032c4431444f7025
Diffstat (limited to 'biometrics')
-rw-r--r-- | biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp | 2 | ||||
-rw-r--r-- | biometrics/fingerprint/2.1/default/BiometricsFingerprint.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp index c6774ca222..f68795955a 100644 --- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp +++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp @@ -145,6 +145,7 @@ FingerprintAcquiredInfo BiometricsFingerprint::VendorAcquiredFilter( Return<uint64_t> BiometricsFingerprint::setNotify( const sp<IBiometricsFingerprintClientCallback>& clientCallback) { + std::lock_guard<std::mutex> lock(mClientCallbackMutex); mClientCallback = clientCallback; // This is here because HAL 2.1 doesn't have a way to propagate a // unique token for its driver. Subsequent versions should send a unique @@ -259,6 +260,7 @@ fingerprint_device_t* BiometricsFingerprint::openHal() { void BiometricsFingerprint::notify(const fingerprint_msg_t *msg) { BiometricsFingerprint* thisPtr = static_cast<BiometricsFingerprint*>( BiometricsFingerprint::getInstance()); + std::lock_guard<std::mutex> lock(thisPtr->mClientCallbackMutex); if (thisPtr == nullptr || thisPtr->mClientCallback == nullptr) { ALOGE("Receiving callbacks before the client callback is registered."); return; diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h index 5923c849c8..6d64e3d38d 100644 --- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h +++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h @@ -69,6 +69,7 @@ private: static FingerprintAcquiredInfo VendorAcquiredFilter(int32_t error, int32_t* vendorCode); static BiometricsFingerprint* sInstance; + std::mutex mClientCallbackMutex; sp<IBiometricsFingerprintClientCallback> mClientCallback; fingerprint_device_t *mDevice; }; |