virtual-image: Open window for race during deactivation

This is in order to test corner cases in fprintd.
This commit is contained in:
Benjamin Berg 2020-10-01 14:16:00 +02:00
parent a63dcc96d5
commit cb56ddba5b

View file

@ -308,6 +308,15 @@ dev_deinit (FpImageDevice *dev)
fpi_device_add_timeout (FP_DEVICE (dev), 100, (FpTimeoutFunc) fpi_image_device_close_complete, NULL, NULL);
}
static void
dev_deactivate (FpImageDevice *dev)
{
G_DEBUG_HERE ();
/* Delay result to open up the possibility of testing race conditions. */
fpi_device_add_timeout (FP_DEVICE (dev), 100, (FpTimeoutFunc) fpi_image_device_deactivate_complete, NULL, NULL);
}
static void
fpi_device_virtual_image_init (FpDeviceVirtualImage *self)
{
@ -331,4 +340,6 @@ fpi_device_virtual_image_class_init (FpDeviceVirtualImageClass *klass)
img_class->img_open = dev_init;
img_class->img_close = dev_deinit;
img_class->deactivate = dev_deactivate;
}