fp-device: Reset the finger status on complete

Devices should handle the finger status internally, but if they don't do it
we need to handle it on actions completion
This commit is contained in:
Marco Trevisan (Treviño) 2020-03-26 22:22:40 +01:00 committed by Marco Trevisan
parent 42e4506b1b
commit 3c382cac7f
2 changed files with 12 additions and 0 deletions

View file

@ -85,6 +85,8 @@ fp_device_cancel_in_idle_cb (gpointer user_data)
cls->cancel (self); cls->cancel (self);
fpi_device_report_finger_status (self, FP_FINGER_STATUS_NONE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@ -635,6 +637,7 @@ fp_device_open (FpDevice *device,
priv->current_action = FPI_DEVICE_ACTION_OPEN; priv->current_action = FPI_DEVICE_ACTION_OPEN;
priv->current_task = g_steal_pointer (&task); priv->current_task = g_steal_pointer (&task);
maybe_cancel_on_cancelled (device, cancellable); maybe_cancel_on_cancelled (device, cancellable);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
FP_DEVICE_GET_CLASS (device)->open (device); FP_DEVICE_GET_CLASS (device)->open (device);
} }

View file

@ -787,6 +787,7 @@ fpi_device_probe_complete (FpDevice *device,
g_debug ("Device reported probe completion"); g_debug ("Device reported probe completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
{ {
@ -829,6 +830,7 @@ fpi_device_open_complete (FpDevice *device, GError *error)
g_debug ("Device reported open completion"); g_debug ("Device reported open completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
{ {
@ -862,6 +864,7 @@ fpi_device_close_complete (FpDevice *device, GError *error)
g_debug ("Device reported close completion"); g_debug ("Device reported close completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
switch (priv->type) switch (priv->type)
{ {
@ -918,6 +921,7 @@ fpi_device_enroll_complete (FpDevice *device, FpPrint *print, GError *error)
g_debug ("Device reported enroll completion"); g_debug ("Device reported enroll completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
{ {
@ -985,6 +989,7 @@ fpi_device_verify_complete (FpDevice *device,
data = g_task_get_task_data (priv->current_task); data = g_task_get_task_data (priv->current_task);
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
{ {
@ -1044,6 +1049,7 @@ fpi_device_identify_complete (FpDevice *device,
data = g_task_get_task_data (priv->current_task); data = g_task_get_task_data (priv->current_task);
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
{ {
@ -1100,6 +1106,7 @@ fpi_device_capture_complete (FpDevice *device,
g_debug ("Device reported capture completion"); g_debug ("Device reported capture completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
{ {
@ -1145,6 +1152,7 @@ fpi_device_delete_complete (FpDevice *device,
g_debug ("Device reported deletion completion"); g_debug ("Device reported deletion completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (!error) if (!error)
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_BOOL, fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_BOOL,
@ -1179,6 +1187,7 @@ fpi_device_list_complete (FpDevice *device,
g_debug ("Device reported listing completion"); g_debug ("Device reported listing completion");
clear_device_cancel_action (device); clear_device_cancel_action (device);
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
if (prints && error) if (prints && error)
{ {