From fb3f98576f23a6093d91013f3d862d1007b6b511 Mon Sep 17 00:00:00 2001 From: Andy Chi Date: Wed, 6 Sep 2023 11:09:05 +0800 Subject: [PATCH] debian/patches/synaptics-fix-enroll_identify-problem-after-user-reset-da.patch (LP: #2034481) --- debian/patches/series | 1 + ...identify-problem-after-user-reset-da.patch | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 debian/patches/synaptics-fix-enroll_identify-problem-after-user-reset-da.patch diff --git a/debian/patches/series b/debian/patches/series index 286a0680..062b68b5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ tests-egis0570-capture.pcapng-Remove-execution-permission.patch tests-Remove-executable-bits-from-installed-libraries.patch tests-Install-current-TOD-driver-in-installed-tests-and-u.patch tests-Use-tests-execdir-install-rpath.patch +synaptics-fix-enroll_identify-problem-after-user-reset-da.patch diff --git a/debian/patches/synaptics-fix-enroll_identify-problem-after-user-reset-da.patch b/debian/patches/synaptics-fix-enroll_identify-problem-after-user-reset-da.patch new file mode 100644 index 00000000..4ba90e5e --- /dev/null +++ b/debian/patches/synaptics-fix-enroll_identify-problem-after-user-reset-da.patch @@ -0,0 +1,92 @@ +From: Vincent Huang +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; + };