mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-02-01 04:30:25 +01:00
supply-battery: Assume battery is present if the attr is missing
Fixes: #208
This commit is contained in:
parent
b1edcc7cbb
commit
c2e48aa9c2
1 changed files with 3 additions and 1 deletions
|
|
@ -145,7 +145,9 @@ up_device_supply_battery_refresh (UpDevice *device,
|
|||
* we can restrict this to updates other than UP_REFRESH_POLL.
|
||||
* NOTE: Only energy.full and cycle_count can change for a battery.
|
||||
*/
|
||||
info.present = g_udev_device_get_sysfs_attr_as_boolean_uncached (native, "present");
|
||||
info.present = TRUE;
|
||||
if (g_udev_device_has_sysfs_attr (native, "present"))
|
||||
info.present = g_udev_device_get_sysfs_attr_as_boolean_uncached (native, "present");
|
||||
if (!info.present) {
|
||||
up_device_battery_update_info (battery, &info);
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue