mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
image-device: Redefine internal states and valid transitions
This adds a number of new internal states to better capture what is going on. Also added are checks that all transitions we make are in the set of expected and valid transitions. Only three drivers use the state_change notification. These drivers are updated accordingly.
This commit is contained in:
@@ -195,7 +195,7 @@ recv_image (FpDeviceVirtualImage *self, GInputStream *stream)
|
||||
g_debug ("Starting image receive (if active), state is: %i", state);
|
||||
|
||||
/* Only register if the state is active. */
|
||||
if (state != FPI_IMAGE_DEVICE_STATE_INACTIVE)
|
||||
if (state >= FPI_IMAGE_DEVICE_STATE_IDLE)
|
||||
{
|
||||
g_input_stream_read_all_async (stream,
|
||||
self->recv_img_hdr,
|
||||
@@ -338,10 +338,10 @@ dev_activate (FpImageDevice *dev)
|
||||
{
|
||||
FpDeviceVirtualImage *self = FPI_DEVICE_VIRTUAL_IMAGE (dev);
|
||||
|
||||
fpi_image_device_activate_complete (dev, NULL);
|
||||
|
||||
if (self->connection)
|
||||
recv_image (self, g_io_stream_get_input_stream (G_IO_STREAM (self->connection)));
|
||||
|
||||
fpi_image_device_activate_complete (dev, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user