sm8350-common: udfps: Compare against the aidl AcquiredInfo

Change-Id: I5b6eb5a4544373d71b89abc0e301126eb55e31d1
This commit is contained in:
Arian 2024-12-28 20:49:24 +01:00 committed by Giovanni Ricca
parent 9dddc05e72
commit 660158f9e5
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View file

@ -11,6 +11,9 @@ cc_library {
shared_libs: [
"libbase",
],
static_libs: [
"android.hardware.biometrics.fingerprint-V4-ndk",
],
header_libs: [
"//hardware/xiaomi:xiaomifingerprint_headers",
],

View file

@ -6,6 +6,7 @@
#define LOG_TAG "UdfpsHandler.xiaomi_sm8350"
#include <aidl/android/hardware/biometrics/fingerprint/BnFingerprint.h>
#include <android-base/logging.h>
#include <fcntl.h>
@ -35,6 +36,8 @@
#define PARAM_FOD_PRESSED 1
#define PARAM_FOD_RELEASED 0
using ::aidl::android::hardware::biometrics::fingerprint::AcquiredInfo;
template <typename T>
static void set(const std::string& path, const T& value) {
std::ofstream file(path);
@ -117,7 +120,7 @@ class XiaomiUdfpsHandler : public UdfpsHandler {
}
void onAcquired(int32_t result, int32_t vendorCode) {
if (result == FINGERPRINT_ACQUIRED_GOOD) {
if (static_cast<AcquiredInfo>(result) == AcquiredInfo::GOOD) {
set(FOD_HBM_PATH, FOD_HBM_OFF);
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
} else if (vendorCode == 21) {