sm8350-common: udfps: Set fod status based on vendor acquired and cancel

Change-Id: I8cbabdfd48576a1afdbf9d2c542ed82a11a4874c
This commit is contained in:
Arian 2023-06-24 17:46:03 +08:00 committed by Flower sea
parent d52d3b7ff7
commit 19cbd7ae08

View File

@ -80,14 +80,7 @@ class XiaomiUdfpsHander : public UdfpsHandler {
continue;
}
if (readBool(fd)) {
mDevice->extCmd(mDevice, COMMAND_NIT, PARAM_NIT_UDFPS);
set(FOD_STATUS_PATH, FOD_STATUS_ON);
} else {
mDevice->extCmd(mDevice, COMMAND_NIT, PARAM_NIT_NONE);
set(FOD_HBM_PATH, FOD_HBM_OFF);
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
}
mDevice->extCmd(mDevice, COMMAND_NIT, readBool(fd) ? PARAM_NIT_UDFPS : PARAM_NIT_NONE);
}
}).detach();
}
@ -100,12 +93,22 @@ class XiaomiUdfpsHander : public UdfpsHandler {
// nothing
}
void onAcquired(int32_t /*result*/, int32_t /*vendorCode*/) {
// nothing
void onAcquired(int32_t result, int32_t vendorCode) {
if (result == FINGERPRINT_ACQUIRED_GOOD) {
set(FOD_HBM_PATH, FOD_HBM_OFF);
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
} else if (vendorCode == 21 || vendorCode == 23) {
/*
* vendorCode = 21 waiting for fingerprint authentication
* vendorCode = 23 waiting for fingerprint enroll
*/
set(FOD_STATUS_PATH, FOD_STATUS_ON);
}
}
void cancel() {
// nothing
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
set(FOD_HBM_PATH, FOD_HBM_OFF);
}
private: