Skip to content

device: Add API for perstistent data storage

Benjamin Berg requested to merge benzea/persistent-data into master

API consumers should fetch the persistent data when they are done and store it to disk. It is undefined when this data is updated by the driver, but in general, it should only be updated once the first time a device is used.

CC: @topni1

This is the minimal and most flexible solution really. I haven't done the fprintd side yet, but really, it is simple. i.e.:

  1. On device discovery/creation try to load data from disk
  2. On device destruction, get the data and save (maybe check if it is unchanged avoid writing then)

In the driver, just do a g_object_get (device, "fpi-persistent-data", &data, NULL); to fetch GVariant (and g_object_set at any time to store it).

Note that the FpDevice code ensures that the device ID and driver match. So the driver should not need many sanity checks.

Merge request reports