debian/patches/synaptics-fix-enroll_identify-problem-after-user-reset-da.patch (LP: #2034481)

This commit is contained in:
Andy Chi
2023-09-06 11:09:05 +08:00
committed by Marco Trevisan (Treviño)
parent 843ca987aa
commit fb3f98576f
2 changed files with 93 additions and 0 deletions
+1
View File
@@ -3,3 +3,4 @@ tests-egis0570-capture.pcapng-Remove-execution-permission.patch
tests-Remove-executable-bits-from-installed-libraries.patch tests-Remove-executable-bits-from-installed-libraries.patch
tests-Install-current-TOD-driver-in-installed-tests-and-u.patch tests-Install-current-TOD-driver-in-installed-tests-and-u.patch
tests-Use-tests-execdir-install-rpath.patch tests-Use-tests-execdir-install-rpath.patch
synaptics-fix-enroll_identify-problem-after-user-reset-da.patch
@@ -0,0 +1,92 @@
From: Vincent Huang <vincenth@synaptics.com>
Date: Tue, 4 Jul 2023 15:45:36 +0800
Subject: synaptics: fix enroll_identify problem after user reset database
---
libfprint/drivers/synaptics/synaptics.c | 23 ++++++++++++++---------
libfprint/drivers/synaptics/synaptics.h | 1 +
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
index f13b820..99717c1 100644
--- a/libfprint/drivers/synaptics/synaptics.c
+++ b/libfprint/drivers/synaptics/synaptics.c
@@ -106,7 +106,11 @@ cmd_receive_cb (FpiUsbTransfer *transfer,
if (self->cmd_complete_on_removal)
{
- fpi_ssm_mark_completed (transfer->ssm);
+ if (self->delay_error)
+ fpi_ssm_mark_failed (transfer->ssm,
+ g_steal_pointer (&self->delay_error));
+ else
+ fpi_ssm_mark_completed (transfer->ssm);
return;
}
}
@@ -641,18 +645,20 @@ verify (FpDevice *device)
}
static void
-identify_complete_after_finger_removal (FpiDeviceSynaptics *self)
+identify_complete_after_finger_removal (FpiDeviceSynaptics *self, GError *error)
{
FpDevice *device = FP_DEVICE (self);
if (self->finger_on_sensor)
{
fp_dbg ("delaying identify report until after finger removal!");
+ g_propagate_error (&self->delay_error, error);
+
self->cmd_complete_on_removal = TRUE;
}
else
{
- fpi_device_identify_complete (device, NULL);
+ fpi_device_identify_complete (device, error);
}
}
@@ -702,19 +708,18 @@ identify_msg_cb (FpiDeviceSynaptics *self,
fp_info ("Match error occurred");
fpi_device_identify_report (device, NULL, NULL,
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
- identify_complete_after_finger_removal (self);
+ identify_complete_after_finger_removal (self, NULL);
}
else if (resp->result == BMKT_FP_NO_MATCH)
{
fp_info ("Print didn't match");
fpi_device_identify_report (device, NULL, NULL, NULL);
- identify_complete_after_finger_removal (self);
+ identify_complete_after_finger_removal (self, NULL);
}
- else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS)
+ else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS || resp->result == BMKT_FP_DATABASE_EMPTY)
{
fp_info ("Print is not in database");
- fpi_device_identify_complete (device,
- fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
+ identify_complete_after_finger_removal (self, fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
}
else
{
@@ -750,7 +755,7 @@ identify_msg_cb (FpiDeviceSynaptics *self,
else
fpi_device_identify_report (device, NULL, print, NULL);
- identify_complete_after_finger_removal (self);
+ identify_complete_after_finger_removal (self, NULL);
}
}
}
diff --git a/libfprint/drivers/synaptics/synaptics.h b/libfprint/drivers/synaptics/synaptics.h
index 5fc0a19..6138db3 100644
--- a/libfprint/drivers/synaptics/synaptics.h
+++ b/libfprint/drivers/synaptics/synaptics.h
@@ -127,4 +127,5 @@ struct _FpiDeviceSynaptics
struct syna_enroll_resp_data enroll_resp_data;
syna_state_t state;
+ GError *delay_error;
};