virtual-device: Report finger presency when we receive a 'SCAN' event

This commit is contained in:
Marco Trevisan (Treviño) 2021-01-25 23:36:00 +01:00
parent 0bb0492025
commit 1dae6796f7
2 changed files with 26 additions and 1 deletions

View file

@ -79,6 +79,10 @@ dev_identify (FpDevice *dev)
fpi_device_identify_report (dev, NULL, NULL, g_steal_pointer (&error)); fpi_device_identify_report (dev, NULL, NULL, g_steal_pointer (&error));
} }
fpi_device_report_finger_status_changes (FP_DEVICE (self),
FP_FINGER_STATUS_NONE,
FP_FINGER_STATUS_PRESENT);
fpi_device_identify_complete (dev, g_steal_pointer (&error)); fpi_device_identify_complete (dev, g_steal_pointer (&error));
} }

View file

@ -383,6 +383,10 @@ start_scan_command (FpDeviceVirtualDevice *self,
if (local_error) if (local_error)
g_propagate_error (error, g_steal_pointer (&local_error)); g_propagate_error (error, g_steal_pointer (&local_error));
else
fpi_device_report_finger_status_changes (FP_DEVICE (self),
FP_FINGER_STATUS_PRESENT,
FP_FINGER_STATUS_NONE);
return g_steal_pointer (&scan_id); return g_steal_pointer (&scan_id);
} }
@ -428,6 +432,10 @@ dev_verify (FpDevice *dev)
g_debug ("Virtual device scan failed with error: %s", error->message); g_debug ("Virtual device scan failed with error: %s", error->message);
} }
fpi_device_report_finger_status_changes (FP_DEVICE (self),
FP_FINGER_STATUS_NONE,
FP_FINGER_STATUS_PRESENT);
if (error && error->domain == FP_DEVICE_RETRY) if (error && error->domain == FP_DEVICE_RETRY)
fpi_device_verify_report (dev, FPI_MATCH_ERROR, NULL, g_steal_pointer (&error)); fpi_device_verify_report (dev, FPI_MATCH_ERROR, NULL, g_steal_pointer (&error));
@ -451,6 +459,7 @@ dev_enroll (FpDevice *dev)
if (id) if (id)
{ {
GVariant *data; GVariant *data;
gboolean completed;
if (self->enroll_stages_passed == 0) if (self->enroll_stages_passed == 0)
{ {
@ -475,8 +484,16 @@ dev_enroll (FpDevice *dev)
} }
self->enroll_stages_passed++; self->enroll_stages_passed++;
completed = self->enroll_stages_passed == fp_device_get_nr_enroll_stages (FP_DEVICE (self));
fpi_device_report_finger_status_changes (FP_DEVICE (self),
completed ?
FP_FINGER_STATUS_NEEDED :
FP_FINGER_STATUS_NONE,
FP_FINGER_STATUS_PRESENT);
fpi_device_enroll_progress (dev, self->enroll_stages_passed, print, NULL); fpi_device_enroll_progress (dev, self->enroll_stages_passed, print, NULL);
if (self->enroll_stages_passed == fp_device_get_nr_enroll_stages (FP_DEVICE (self)))
if (completed)
{ {
if (self->prints_storage) if (self->prints_storage)
{ {
@ -490,6 +507,10 @@ dev_enroll (FpDevice *dev)
} }
else else
{ {
fpi_device_report_finger_status_changes (FP_DEVICE (self),
FP_FINGER_STATUS_NONE,
FP_FINGER_STATUS_PRESENT);
if (error && error->domain == FP_DEVICE_RETRY) if (error && error->domain == FP_DEVICE_RETRY)
{ {
fpi_device_enroll_progress (dev, self->enroll_stages_passed, NULL, g_steal_pointer (&error)); fpi_device_enroll_progress (dev, self->enroll_stages_passed, NULL, g_steal_pointer (&error));