sm8350-common: udfps: Compare against the aidl AcquiredInfo
Change-Id: I5b6eb5a4544373d71b89abc0e301126eb55e31d1
This commit is contained in:
parent
9dddc05e72
commit
660158f9e5
2 changed files with 7 additions and 1 deletions
|
|
@ -11,6 +11,9 @@ cc_library {
|
|||
shared_libs: [
|
||||
"libbase",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.biometrics.fingerprint-V4-ndk",
|
||||
],
|
||||
header_libs: [
|
||||
"//hardware/xiaomi:xiaomifingerprint_headers",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue