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
This commit is contained in:
Benjamin Berg
2020-01-13 16:08:34 +01:00
committed by Bastien Nocera
parent a520896325
commit deb3c25e51

View File

@ -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