diff -Nru libfprint-1.94.5+tod1/debian/changelog libfprint-1.94.5+tod1/debian/changelog --- libfprint-1.94.5+tod1/debian/changelog 2023-04-12 16:45:01.000000000 +0800 +++ libfprint-1.94.5+tod1/debian/changelog 2023-09-07 14:36:44.000000000 +0800 @@ -1,3 +1,11 @@ +libfprint (1:1.94.5+tod1-0ubuntu3) lunar; urgency=medium + + * debian/patches/synaptics-fix-enroll_identify-problem-after-user-res.patch + - cherry pick a fix for the enroll failed when database is cleared by BIOS. + (lp: #2034481) + + -- Andy Chi Thu, 07 Sep 2023 14:36:44 +0800 + libfprint (1:1.94.5+tod1-0ubuntu2) lunar; urgency=medium * debian/patches/git_tests_fix.patch: diff -Nru libfprint-1.94.5+tod1/debian/patches/series libfprint-1.94.5+tod1/debian/patches/series --- libfprint-1.94.5+tod1/debian/patches/series 2023-04-12 16:45:01.000000000 +0800 +++ libfprint-1.94.5+tod1/debian/patches/series 2023-09-07 14:36:44.000000000 +0800 @@ -1 +1,2 @@ git_tests_fix.patch +synaptics-fix-enroll_identify-problem-after-user-res.patch diff -Nru libfprint-1.94.5+tod1/debian/patches/synaptics-fix-enroll_identify-problem-after-user-res.patch libfprint-1.94.5+tod1/debian/patches/synaptics-fix-enroll_identify-problem-after-user-res.patch --- libfprint-1.94.5+tod1/debian/patches/synaptics-fix-enroll_identify-problem-after-user-res.patch 1970-01-01 08:00:00.000000000 +0800 +++ libfprint-1.94.5+tod1/debian/patches/synaptics-fix-enroll_identify-problem-after-user-res.patch 2023-09-07 14:36:44.000000000 +0800 @@ -0,0 +1,94 @@ +From 206e92218c0209d70f156af08a17f9d945fa1b63 Mon Sep 17 00:00:00 2001 +From: Vincent Huang +Date: Tue, 4 Jul 2023 15:45:36 +0800 +Subject: [PATCH] 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(-) + +Index: libfprint-ubuntu/libfprint/drivers/synaptics/synaptics.c +=================================================================== +--- libfprint-ubuntu.orig/libfprint/drivers/synaptics/synaptics.c ++++ libfprint-ubuntu/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 *sel + 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 *sel + else + fpi_device_identify_report (device, NULL, print, NULL); + +- identify_complete_after_finger_removal (self); ++ identify_complete_after_finger_removal (self, NULL); + } + } + } +Index: libfprint-ubuntu/libfprint/drivers/synaptics/synaptics.h +=================================================================== +--- libfprint-ubuntu.orig/libfprint/drivers/synaptics/synaptics.h ++++ libfprint-ubuntu/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; + };