From e3f581297fd96b86b48fded3fc4c409e9e4a0014 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 21 Aug 2018 13:03:37 -0500 Subject: [PATCH] upower: Allow forcing installation even if no AC power is applied --- plugins/upower/fu-plugin-upower.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/upower/fu-plugin-upower.c b/plugins/upower/fu-plugin-upower.c index 089c35f03..61bfd3ece 100644 --- a/plugins/upower/fu-plugin-upower.c +++ b/plugins/upower/fu-plugin-upower.c @@ -64,12 +64,12 @@ fu_plugin_update_prepare (FuPlugin *plugin, g_warning ("failed to get OnBattery value, assume on AC power"); return TRUE; } - if (g_variant_get_boolean (value)) { + if (g_variant_get_boolean (value) && (flags & FWUPD_INSTALL_FLAG_FORCE) == 0) { g_set_error_literal (error, FWUPD_ERROR, FWUPD_ERROR_AC_POWER_REQUIRED, "Cannot install update " - "when not on AC power"); + "when not on AC power unless forced"); return FALSE; } return TRUE;