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