Check FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN when calculating the SUPPORTED flag

If the device is on battery power, the device will have at least one inhibit
and be in FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN state.

It's still supported, and it's misleading to suggest there are no updates
available. Just check both flags.

Fixes the 3rd half (sic) of https://github.com/fwupd/fwupd/issues/3156
This commit is contained in:
Richard Hughes 2021-04-22 12:06:04 +01:00
parent e69f0f5f7c
commit 6b64bc7afa

View File

@ -4580,7 +4580,8 @@ fu_engine_get_releases_for_device (FuEngine *self,
}
/* only show devices that can be updated */
if (!fu_device_has_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE)) {
if (!fu_device_has_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE) &&
!fu_device_has_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)) {
g_set_error_literal (error,
FWUPD_ERROR,
FWUPD_ERROR_NOT_SUPPORTED,