device: Add feature flag for continuous scanning support

Devices that are considered to never run hot will have FEATURE_ALWAYS_ON
set. If set, the UI can safely assume that it is fine to run fingerprint
authentication in the background without other user interaction.

Closes: #346
This commit is contained in:
Benjamin Berg 2021-08-05 16:43:47 +02:00
parent 6440a7d12f
commit da28731adc
2 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,7 @@ typedef enum {
* @FP_DEVICE_FEATURE_STORAGE_DELETE: Supports deleting stored templates
* @FP_DEVICE_FEATURE_STORAGE_CLEAR: Supports clearing the whole storage
* @FP_DEVICE_FEATURE_DUPLICATES_CHECK: Natively supports duplicates detection
* @FP_DEVICE_FEATURE_ALWAYS_ON: Whether the device can run continuously
*/
typedef enum /*< flags >*/ {
FP_DEVICE_FEATURE_NONE = 0,
@ -69,6 +70,7 @@ typedef enum /*< flags >*/ {
FP_DEVICE_FEATURE_STORAGE_DELETE = 1 << 5,
FP_DEVICE_FEATURE_STORAGE_CLEAR = 1 << 6,
FP_DEVICE_FEATURE_DUPLICATES_CHECK = 1 << 7,
FP_DEVICE_FEATURE_ALWAYS_ON = 1 << 8,
} FpDeviceFeature;
/**

View File

@ -80,6 +80,9 @@ fpi_device_class_auto_initialize_features (FpDeviceClass *device_class)
if (device_class->delete && (device_class->list || device_class->clear_storage))
device_class->features |= FP_DEVICE_FEATURE_STORAGE;
if (device_class->temp_hot_seconds < 0)
device_class->features |= FP_DEVICE_FEATURE_ALWAYS_ON;
}
/**