trivial: don't show devices with inhibit id: hidden

dell-dock: don't show thunderbolt's usb4 device, if inhibited
This commit is contained in:
hugh712 2022-07-05 11:18:23 +08:00 committed by Richard Hughes
parent 07d5bf12e4
commit 4bf53196fc
2 changed files with 3 additions and 1 deletions

View File

@ -255,7 +255,7 @@ fu_plugin_dell_dock_device_registered(FuPlugin *plugin, FuDevice *device)
g_autofree gchar *msg = NULL; g_autofree gchar *msg = NULL;
msg = g_strdup_printf("firmware update inhibited by [%s] plugin", msg = g_strdup_printf("firmware update inhibited by [%s] plugin",
fu_plugin_get_name(plugin)); fu_plugin_get_name(plugin));
fu_device_inhibit(device, "usb4-blocked", msg); fu_device_inhibit(device, "hidden", msg);
return; return;
} }

View File

@ -215,6 +215,8 @@ fu_device_list_get_active(FuDeviceList *self)
FuDeviceItem *item = g_ptr_array_index(self->devices, i); FuDeviceItem *item = g_ptr_array_index(self->devices, i);
if (fu_device_has_inhibit(item->device, "unconnected")) if (fu_device_has_inhibit(item->device, "unconnected"))
continue; continue;
if (fu_device_has_inhibit(item->device, "hidden"))
continue;
g_ptr_array_add(devices, g_object_ref(item->device)); g_ptr_array_add(devices, g_object_ref(item->device));
} }
g_rw_lock_reader_unlock(&self->devices_mutex); g_rw_lock_reader_unlock(&self->devices_mutex);