Include <stdint.h> so that <linux/fs.h> can use uint64_t. Arguably a bug in the
kernel headers, but it costs us nothing to safeguard against it.
CC libupshared_la-up-device-idevice.lo
In file included from sysfs-utils.c:39:0:
/usr/include/linux/fs.h:37:2: error: expected specifier-qualifier-list before ‘uint64_t’
When a full battery starts to discharge, but reports its status as 'Unknown',
it takes a few minutes before g-p-m notices any change.
upowerd guesses the battery is fully charged as long as it has over 90% charge.
I see no reason to delay the reporting of discharging of the battery.
Let's remove this heuristic.
Signed-off-by: Richard Hughes <richard@hughsie.com>
Commmit fc7c6e003 had a thinko, UP_DAEMON_WATERLINE specifies (active
memory)/(available swap), not the other way around. So replace it with 99%
instead.
Also update the documentation of up_backend_get_used_swap() to explain what the
returned percentage actually means.
In linux backend, g_object_set was called with wrong
argument types for time-to-empty,time-to-full and percentage
properties. This patch uses explicit casts in the same way as freebsd
backend.
Signed-off-by: Mariusz Ceier <mceier@gmail.com>
pm-is-supported does all the work upower was duplicating, and it handles more
use cases than the old upower code did. No point in duplicating functionality.
Signed-off-by: Richard Hughes <richard@hughsie.com>
up_daemon_check_swap_space uses the Active: line from /proc/meminfo to
determine the amount of swap the system needs to be able to suspend. However,
because Active: includes both anonymous and file-backed pages, this greatly
overestimates the amount of swap needed. File-backed pages can be written back
to disk and so do not consume swap.
Instead, up_daemon_check_swap_space should use Active(anon): from /proc/meminfo
because only anonymous pages need to be written out to swap during a suspend.
Signed-off-by: Richard Hughes <richard@hughsie.com>
The backends [linux/freebsd/dummy] no longer require
libdevkit-power-gobject, so
- remove -I$(top_srcdir)/devkit-power-gobject from the include path
- don't link the backends against libdevkit-power-gobject but upowerd
(which unfortunately still needs it).
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
The percentage field of the device object is a gdouble. Low battery
calculations should read this field as a gdouble instead of a guint to
get the correct value. This fixes the case where clients see
on-low-battery possibly changing with every percentage of battery
discharge.
Signed-off-by: Byron Clark <byron@theclarkfamily.name>