mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-15 11:59:02 +00:00
trivial: Add fu_device_has_problem() to be consistent and hide details
This commit is contained in:
parent
354122e83c
commit
f3f951d3a7
@ -3069,6 +3069,25 @@ fu_device_remove_problem(FuDevice *self, FwupdDeviceProblem problem)
|
||||
return fu_device_uninhibit(self, fwupd_device_problem_to_string(problem));
|
||||
}
|
||||
|
||||
/**
|
||||
* fu_device_has_problem:
|
||||
* @self: a #FuDevice
|
||||
* @problem: a #FwupdDeviceProblem, e.g. %FWUPD_DEVICE_PROBLEM_SYSTEM_POWER_TOO_LOW
|
||||
*
|
||||
* Query if a device has a specific problem.
|
||||
*
|
||||
* Returns: %TRUE if the device has this problem
|
||||
*
|
||||
* Since: 1.8.11
|
||||
**/
|
||||
gboolean
|
||||
fu_device_has_problem(FuDevice *self, FwupdDeviceProblem problem)
|
||||
{
|
||||
g_return_val_if_fail(FU_IS_DEVICE(self), FALSE);
|
||||
g_return_val_if_fail(problem != FWUPD_DEVICE_PROBLEM_UNKNOWN, FALSE);
|
||||
return fu_device_has_inhibit(self, fwupd_device_problem_to_string(problem));
|
||||
}
|
||||
|
||||
/**
|
||||
* fu_device_add_problem:
|
||||
* @self: a #FuDevice
|
||||
|
@ -562,6 +562,8 @@ fu_device_add_problem(FuDevice *self, FwupdDeviceProblem problem);
|
||||
void
|
||||
fu_device_remove_problem(FuDevice *self, FwupdDeviceProblem problem);
|
||||
gboolean
|
||||
fu_device_has_problem(FuDevice *self, FwupdDeviceProblem problem);
|
||||
gboolean
|
||||
fu_device_has_inhibit(FuDevice *self, const gchar *inhibit_id);
|
||||
const gchar *
|
||||
fu_device_get_physical_id(FuDevice *self);
|
||||
|
@ -1165,6 +1165,7 @@ LIBFWUPDPLUGIN_1.8.10 {
|
||||
|
||||
LIBFWUPDPLUGIN_1.8.11 {
|
||||
global:
|
||||
fu_device_has_problem;
|
||||
fu_device_remove_backend_tag;
|
||||
local: *;
|
||||
} LIBFWUPDPLUGIN_1.8.10;
|
||||
|
@ -609,7 +609,7 @@ fu_device_list_clear_wait_for_replug(FuDeviceList *self, FuDeviceItem *item)
|
||||
static void
|
||||
fu_device_incorporate_problem_update_in_progress(FuDevice *self, FuDevice *donor)
|
||||
{
|
||||
if (fu_device_has_inhibit(donor, "update-in-progress")) {
|
||||
if (fu_device_has_problem(donor, FWUPD_DEVICE_PROBLEM_UPDATE_IN_PROGRESS)) {
|
||||
g_debug("moving inhibit update-in-progress to active device");
|
||||
fu_device_add_problem(self, FWUPD_DEVICE_PROBLEM_UPDATE_IN_PROGRESS);
|
||||
fu_device_remove_problem(donor, FWUPD_DEVICE_PROBLEM_UPDATE_IN_PROGRESS);
|
||||
|
Loading…
Reference in New Issue
Block a user