synaptics: Immediately succeed for empty identify

Such an empty identify can be run by fprintd intentionally for duplicate
checking at the start of an enroll operation, which currently runs into
an error from the driver.

Avoid this by simply returning success immediately. This is fine, as
synaptics is only checking the explicitly passed list of prints rather
than using all available prints from the storage.
This commit is contained in:
Benjamin Berg 2021-07-08 14:07:25 +02:00 committed by Benjamin Berg
parent 9ecd6236ee
commit 9e7bfa05b3

View file

@ -717,6 +717,21 @@ identify_msg_cb (FpiDeviceSynaptics *self,
static void
identify (FpDevice *device)
{
GPtrArray *prints = NULL;
fpi_device_get_identify_data (device, &prints);
/* Identify over no prints does not work for synaptics.
* This *may* make sense for other devices though, as identify may return
* a matched print even if it is not in the list of prints.
*/
if (prints->len == 0)
{
fpi_device_identify_report (device, NULL, NULL, NULL);
fpi_device_identify_complete (device, NULL);
return;
}
init_identify_msg (device);
compose_and_send_identify_msg (device);
}