From 420fd7416dcbe242a507fd93c89a3bd44f6d8a1f Mon Sep 17 00:00:00 2001 From: haoweilo Date: Wed, 20 Mar 2024 16:29:36 +0800 Subject: fpcmoc: fix incorrect immobile handling during enrollment For the custom enrollment, if the number of immobile touches have reached the maximum, we should treat this touch as normal (valid) and increase the enrollment progress. --- libfprint/drivers/fpcmoc/fpc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libfprint/drivers/fpcmoc/fpc.c b/libfprint/drivers/fpcmoc/fpc.c index 87ab154..0a7bc14 100644 --- a/libfprint/drivers/fpcmoc/fpc.c +++ b/libfprint/drivers/fpcmoc/fpc.c @@ -741,15 +741,19 @@ fpc_enroll_update_cb (FpiDeviceFpcMoc *self, /* here should tips remove finger and try again */ if (self->max_immobile_stage) { - if (self->immobile_stage >= self->max_immobile_stage) + self->immobile_stage++; + if (self->immobile_stage > self->max_immobile_stage) { fp_dbg ("Skip similar handle due to customer enrollment %d(%d)", self->immobile_stage, self->max_immobile_stage); /* Skip too similar handle, treat as normal enroll progress. */ - fpi_ssm_jump_to_state (self->task_ssm, FPC_ENROL_STATUS_PROGRESS); + self->enroll_stage++; + fpi_device_enroll_progress (FP_DEVICE (self), self->enroll_stage, NULL, NULL); + /* Used for customer enrollment scheme */ + if (self->enroll_stage >= (self->max_enroll_stage - self->max_immobile_stage)) + fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_COMPLETE); break; } - self->immobile_stage++; } fpi_device_enroll_progress (FP_DEVICE (self), self->enroll_stage, -- cgit v1.2.3