This allows us to ignore all the delays when the device is emulated, with the
idea being to do dozens of device emulations in the CI tests.
Also, do not call fu_progress_sleep() when the device is emulated.
If the device does not replug, and we change the GUsbDevice because the phase
changed we don't want reprobe the hardware.
If we reprobe then the emulated device will request extra data compared to the
real device, which will cause emulation to fail.
This can save 250us on each query (of which we do a *lot*), and reduces the
number of queries by about half if the user is using a libxmlb version that can
convert from `_BOUND_TEXT` to `_BOUND_INDEX_TEXT`.
The more devices detected, the bigger the difference, and without this patch
fixing libxmlb would break fwupd as we'e been searching with an index, but not
actually providing one.
This is moderately expensive to call as it processes each requirement on each
release on each device, so the last thing we want to do is call it *twice*.
It turns out we do not want to know the current phase of the device, and we can
achieve the same thing tagging the GUsbDevice manually and clearing the events
at exactly the correct time.
fwupd-efi 1.4 enforces that NX bit is set by default.
This won't affect most users, it should only affect those that compile
by hand and don't have fwupd-efi installed already.
The fu_engine_get_device() function is called at the start of each phase,
which calls fu_device_list_wait_for_replug() a second time.
Duplicate calls are at best confusing, and at worst could cause a 'device
failed to come back' failure.
We already had this as an inhibit, but this was not translated client-side.
We also need to propagate the problem to the bootloader device if the device
replugs during firmware update.
Sometimes the flash process will randomly hang and time-out when sending
data to the device. We currently do not use any retry logic, so if this
happens the flash attempt is treated as a failure. This can be a source
of worry or frustration, especially if subsequent manual retries fail
in a similar way.
Adding FU_HID_DEVICE_FLAG_RETRY_FAILURE to the list of flags used when
calling fu_hid_device_set_report allows fwupd to try sending a block
multiple times if such a time-out (or other error) occurs. This makes
the flash process less prone to failure.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>