From deb3c25e5144f16cc340feed9c7b926dc8426e75 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 13 Jan 2020 16:08:34 +0100 Subject: [PATCH] device: Adjust to new libfprint API for early match reporting This API was added to libfprint to allow drivers to report the match result early before the operation has been completed. No driver makes use of this facility yet and instead drivers try to finish the operation early for quick result reporting. This primarily means not waiting for finger removal. Once drivers are updated, fprintd reactivity will regress unless the early match callback is implemented as they would only get an operation finished callback when the whole of the operation was finished, including finger removal and finishing up USB communications. See: https://gitlab.freedesktop.org/libfprint/fprintd/issues/35 --- src/device.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index cab6185..7239bf5 100644 --- a/src/device.c +++ b/src/device.c @@ -748,9 +748,11 @@ static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data) if (error && error->domain == FP_DEVICE_RETRY) { g_signal_emit(rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, FALSE); + /* TODO: Support early match result callback from libfprint */ fp_device_verify (priv->dev, priv->verify_data, priv->current_cancellable, + NULL, NULL, NULL, (GAsyncReadyCallback) verify_cb, rdev); } else { @@ -794,9 +796,11 @@ static void identify_cb(FpDevice *dev, GAsyncResult *res, void *user_data) if (error && error->domain == FP_DEVICE_RETRY) { g_signal_emit (rdev, signals[SIGNAL_VERIFY_STATUS], 0, name, FALSE); + /* TODO: Support early match result callback from libfprint */ fp_device_identify (priv->dev, priv->identify_data, priv->current_cancellable, + NULL, NULL, NULL, (GAsyncReadyCallback) identify_cb, rdev); } else { @@ -891,7 +895,10 @@ static void fprint_device_verify_start(FprintDevice *rdev, g_debug ("start identification device %d", priv->id); priv->current_cancellable = g_cancellable_new (); priv->identify_data = g_ptr_array_ref (gallery); - fp_device_identify (priv->dev, gallery, priv->current_cancellable, (GAsyncReadyCallback) identify_cb, rdev); + /* TODO: Support early match result callback from libfprint */ + fp_device_identify (priv->dev, gallery, priv->current_cancellable, + NULL, NULL, NULL, + (GAsyncReadyCallback) identify_cb, rdev); } else { priv->current_action = ACTION_VERIFY; @@ -909,7 +916,10 @@ static void fprint_device_verify_start(FprintDevice *rdev, priv->current_cancellable = g_cancellable_new (); priv->verify_data = g_object_ref (print); - fp_device_verify (priv->dev, print, priv->current_cancellable, (GAsyncReadyCallback) verify_cb, rdev); + /* TODO: Support early match result callback from libfprint */ + fp_device_verify (priv->dev, print, priv->current_cancellable, + NULL, NULL, NULL, + (GAsyncReadyCallback) verify_cb, rdev); } /* Emit VerifyFingerSelected telling the front-end which finger