sm8450-common: udfps: Keep fod_status enabled during enroll

Change-Id: Ie09efc80c6d4ad06db82c5c693f202f651fd56dd
This commit is contained in:
Arian 2023-08-02 09:35:49 +02:00
parent b2dcc1ec15
commit ec8786ca3a

View file

@ -116,7 +116,9 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
LOG(INFO) << __func__ << " result: " << result << " vendorCode: " << vendorCode;
if (result == FINGERPRINT_ACQUIRED_GOOD) {
setFingerDown(false);
setFodStatus(FOD_STATUS_OFF);
if (!enrolling) {
setFodStatus(FOD_STATUS_OFF);
}
} else if (vendorCode == 21 || vendorCode == 23) {
/*
* vendorCode = 21 waiting for fingerprint authentication
@ -128,13 +130,33 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
void cancel() {
LOG(INFO) << __func__;
enrolling = false;
setFingerDown(false);
setFodStatus(FOD_STATUS_OFF);
}
void preEnroll() {
LOG(INFO) << __func__;
enrolling = true;
}
void enroll() {
LOG(INFO) << __func__;
enrolling = true;
}
void postEnroll() {
LOG(INFO) << __func__;
enrolling = false;
setFodStatus(FOD_STATUS_OFF);
}
private:
fingerprint_device_t* mDevice;
android::base::unique_fd touch_fd_;
bool enrolling = false;
void setFodStatus(int value) {
int buf[MAX_BUF_SIZE] = {TOUCH_ID, Touch_Fod_Enable, value};