mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 13:00:08 +00:00
focaltech_moc: Do not set delete feature for 6553
This commit is contained in:
@@ -1801,16 +1801,8 @@ static void
|
|||||||
focaltech_moc_delete_print (FpDevice *device)
|
focaltech_moc_delete_print (FpDevice *device)
|
||||||
{
|
{
|
||||||
FpiDeviceFocaltechMoc *self = FPI_DEVICE_FOCALTECH_MOC (device);
|
FpiDeviceFocaltechMoc *self = FPI_DEVICE_FOCALTECH_MOC (device);
|
||||||
guint64 quirk = fpi_device_get_driver_data (device);
|
|
||||||
FpActionData *data = NULL;
|
FpActionData *data = NULL;
|
||||||
|
|
||||||
if (quirk == FOCALTECH_QUIRK_SINGLE_SLOT)
|
|
||||||
{
|
|
||||||
fpi_device_delete_complete (FP_DEVICE (self),
|
|
||||||
fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
data = g_new0 (FpActionData, 1);
|
data = g_new0 (FpActionData, 1);
|
||||||
data->enrolled_info = g_new0 (struct EnrolledInfo, 1);
|
data->enrolled_info = g_new0 (struct EnrolledInfo, 1);
|
||||||
data->list_result = g_ptr_array_new_with_free_func (g_object_unref);
|
data->list_result = g_ptr_array_new_with_free_func (g_object_unref);
|
||||||
@@ -1966,6 +1958,17 @@ fpi_device_focaltech_moc_init (FpiDeviceFocaltechMoc *self)
|
|||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
focaltech_moc_probe (FpDevice *device)
|
||||||
|
{
|
||||||
|
guint64 quirk = fpi_device_get_driver_data (device);
|
||||||
|
|
||||||
|
if (quirk == FOCALTECH_QUIRK_SINGLE_SLOT)
|
||||||
|
fpi_device_update_features (device, FP_DEVICE_FEATURE_STORAGE_DELETE, 0);
|
||||||
|
|
||||||
|
fpi_device_probe_complete (device, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fpi_device_focaltech_moc_class_init (FpiDeviceFocaltechMocClass *klass)
|
fpi_device_focaltech_moc_class_init (FpiDeviceFocaltechMocClass *klass)
|
||||||
{
|
{
|
||||||
@@ -1980,6 +1983,7 @@ fpi_device_focaltech_moc_class_init (FpiDeviceFocaltechMocClass *klass)
|
|||||||
dev_class->nr_enroll_stages = FOCALTECH_MOC_MAX_FINGERS;
|
dev_class->nr_enroll_stages = FOCALTECH_MOC_MAX_FINGERS;
|
||||||
dev_class->temp_hot_seconds = -1;
|
dev_class->temp_hot_seconds = -1;
|
||||||
|
|
||||||
|
dev_class->probe = focaltech_moc_probe;
|
||||||
dev_class->open = focaltech_moc_open;
|
dev_class->open = focaltech_moc_open;
|
||||||
dev_class->close = focaltech_moc_close;
|
dev_class->close = focaltech_moc_close;
|
||||||
dev_class->verify = focaltech_moc_identify;
|
dev_class->verify = focaltech_moc_identify;
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ del devices
|
|||||||
d.open_sync()
|
d.open_sync()
|
||||||
assert d.get_driver() == "focaltech_moc"
|
assert d.get_driver() == "focaltech_moc"
|
||||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
|
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
|
||||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
|
assert not d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
|
||||||
#added storage clear
|
|
||||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
||||||
|
|
||||||
|
|
||||||
@@ -54,27 +53,17 @@ verify_res, verify_print = d.verify_sync(p)
|
|||||||
assert verify_res == True
|
assert verify_res == True
|
||||||
print("Verify done.")
|
print("Verify done.")
|
||||||
|
|
||||||
|
print("Delete is a no-op here")
|
||||||
|
d.delete_print_sync(p)
|
||||||
|
|
||||||
print('Identifying...')
|
print('Identifying...')
|
||||||
match, identify_print = d.identify_sync(stored, None, None, None)
|
match, identify_print = d.identify_sync(stored, None, None, None)
|
||||||
|
|
||||||
if match:
|
print('Identification SUCCESS')
|
||||||
print('Identification SUCCESS')
|
assert match.equal(identify_print)
|
||||||
assert match.equal(identify_print)
|
assert match.equal(p)
|
||||||
else:
|
|
||||||
print('Identification FAILURE')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
print("Deleting...")
|
print("Clearing storage...")
|
||||||
try:
|
|
||||||
d.delete_print_sync(stored[0])
|
|
||||||
except GLib.Error as error:
|
|
||||||
assert error.matches(FPrint.DeviceError.quark(),
|
|
||||||
FPrint.DeviceError.NOT_SUPPORTED)
|
|
||||||
else:
|
|
||||||
raise AssertionError("delete_print_sync unexpectedly succeeded")
|
|
||||||
print("Delete not supported verified.")
|
|
||||||
|
|
||||||
print("Clearing storage (0xAC)...")
|
|
||||||
d.clear_storage_sync()
|
d.clear_storage_sync()
|
||||||
|
|
||||||
final_list = d.list_prints_sync()
|
final_list = d.list_prints_sync()
|
||||||
|
|||||||
Reference in New Issue
Block a user