mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-28 15:05:53 +00:00

A series of changes are made to the powerd skeleton plugin in order to reach two goals: ensuring that it handles cases correctly, given certain information about the battery and/or certain return types and that it successfully retrieves battery information from powerd to be used later. Logic is then added to ensure updates are only performed when that battery level is at or above the minimum threshold. Then logic is added that checks if the device being updating requires AC power. Along with this, specific error statements are added for each scenario where an update is blocked. To address the next goal, within fu_plugin_startup(), a GDBus connection is established. However, instead of a direct connection to powerd, the connection is changed to link to the general system bus with g_bus_get_sync(). From there, a proxy is created to represent the connection to powerd. A test call is made for the name of the service that the proxy represents to check for successful communication. Then, in fu_plugin_update_prepare(), the existing proxy is called and in the call, the "GetBatteryState" is passed to make a method call method. The response is filled into a GVariant, whose entries are initialized in new variables to use for battery checks. And checks are added to make sure every step was successful.
457 B
457 B
Powerd Support
Introduction
This plugin is used to ensure that some updates are not done on battery power and that there is sufficient battery power for certain updates that are.
Vendor ID Security
This protocol does not create a device and thus requires no vendor ID set.
External interface access
This plugin requires access to the org.chromium.PowerManager
DBus interface.