fpi-image-device: Reorder image state not to change values

We need this to avoid breaking already present TOD image devices
drivers.
This commit is contained in:
Marco Trevisan (Treviño)
2020-12-03 01:41:15 +01:00
parent 7dc2cbf8d9
commit 99063246b7
2 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -208,8 +208,12 @@ recv_image (FpDeviceVirtualImage *self, GInputStream *stream)
g_debug ("Starting image receive (if active), state is: %i", state); g_debug ("Starting image receive (if active), state is: %i", state);
/* Only register if the state is active. */ /* Only register if the state is active. */
if (state >= FPI_IMAGE_DEVICE_STATE_IDLE) switch (state)
{ {
case FPI_IMAGE_DEVICE_STATE_IDLE:
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON:
case FPI_IMAGE_DEVICE_STATE_CAPTURE:
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF:
g_input_stream_read_all_async (stream, g_input_stream_read_all_async (stream,
self->recv_img_hdr, self->recv_img_hdr,
sizeof (self->recv_img_hdr), sizeof (self->recv_img_hdr),
@@ -217,6 +221,10 @@ recv_image (FpDeviceVirtualImage *self, GInputStream *stream)
self->cancellable, self->cancellable,
recv_image_hdr_recv_cb, recv_image_hdr_recv_cb,
self); self);
/* fallthrough */
default:
break;
} }
} }
+3 -3
View File
@@ -62,12 +62,12 @@
*/ */
typedef enum { typedef enum {
FPI_IMAGE_DEVICE_STATE_INACTIVE, FPI_IMAGE_DEVICE_STATE_INACTIVE,
FPI_IMAGE_DEVICE_STATE_ACTIVATING,
FPI_IMAGE_DEVICE_STATE_DEACTIVATING,
FPI_IMAGE_DEVICE_STATE_IDLE,
FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON,
FPI_IMAGE_DEVICE_STATE_CAPTURE, FPI_IMAGE_DEVICE_STATE_CAPTURE,
FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF,
FPI_IMAGE_DEVICE_STATE_ACTIVATING,
FPI_IMAGE_DEVICE_STATE_DEACTIVATING,
FPI_IMAGE_DEVICE_STATE_IDLE,
} FpiImageDeviceState; } FpiImageDeviceState;
/** /**