virtual-device: Mark finger as needed only after we start scanning

In case we sent a sleep event to the device we may want to wait it to
emit the finger needed state before the timeout is completed.

So add a function to manage this for all the scan cases
This commit is contained in:
Marco Trevisan (Treviño)
2021-01-25 22:47:40 +01:00
parent 3db0858fb0
commit 0bb0492025
4 changed files with 70 additions and 15 deletions
+4 -5
View File
@@ -41,13 +41,12 @@ dev_identify (FpDevice *dev)
GPtrArray *prints;
g_autofree char *scan_id = NULL;
fpi_device_get_identify_data (dev, &prints);
fpi_device_report_finger_status (dev, FP_FINGER_STATUS_NEEDED);
scan_id = process_cmds (self, TRUE, &error);
if (should_wait_for_command (self, error))
scan_id = start_scan_command (self, &error);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PENDING))
return;
fpi_device_get_identify_data (dev, &prints);
if (scan_id)
{
GVariant *data = NULL;