Commit graph

734 commits

Author SHA1 Message Date
Richard Hughes
3901d902fd Move the wacom hack to allow us to support other types of USB device 2011-11-29 14:05:18 +00:00
Richard Hughes
d4ea1cb566 If a power-supply device doesn't report charge or energy, try to read the percentage 2011-11-29 14:04:22 +00:00
Martin Pitt
46f1c7f028 Fix crash in up_device_csr_finalize()
Spotted when running regression tests in KVM. There, initializing a HID device
causes a "could not initialize libusb: -99" warning, but the device is created
nevertheless. Do not crash in _finalize() by trying to call libusb_exit(NULL).
2011-11-11 15:50:15 +01:00
Martin Pitt
d92aec6520 src/linux/integration-test: Port to Python 3 2011-11-11 15:19:04 +01:00
Leonardo Robol
b971b43c45 Use linear regression to get better predicted battery times
For hardware that has no rate data we use the differences in charge over a time
period to work out the effective rate. Using linear regression this estimation
is much more realistic.

To do this, introduce a simple circular buffer and use an index to calculate
the rate on each update.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-10-19 17:13:51 +01:00
Richard Hughes
58f77e8aa6 Don't spam the log when we're saving history when on low power
Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=41486
2011-10-06 09:12:04 +01:00
Landry Breuil
60e5e29188 Add --with-historydir to specify where we want the history files to be stored
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-10-04 14:53:46 +01:00
Richard Hughes
5b46a00a32 trivial: post release version bump 2011-10-03 11:19:56 +01:00
Richard Hughes
b387e1a46b Released UPower 0.9.14 2011-10-03 11:18:33 +01:00
Richard Hughes
52bef2b461 Filter all the debugging details unless --verbose is specified
Now systemd is pushing all our debugging to syslog, we're upsetting some people.
2011-09-28 16:13:20 +01:00
Richard Hughes
fe643d6fc0 trivial: remove an overzealous warning when starting up 2011-09-28 16:12:40 +01:00
Christian Seiler
ff23a9c6e2 Fix linux up_backend_supports_sleep_state() return code.
Under Linux, regardless of the exit code of /usr/bin/pm-is-supported, it will
always set CanSuspend and CanHibernate to true due to a logic error in
up_backend_supports_sleep_state in src/linux/up-backend.c: The 'ret' variable
is re-used for the return code without being re-initialized to false after the
call to g_spawn_command_line_sync.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-09-22 17:34:45 +02:00
Pino Toscano
626c087b48 Fix the kFreeBSD detection
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-09-08 15:35:14 +01:00
Richard Hughes
e2e8dd9603 Add the website sources to git
In the case of a hit-by-a-bus event...
2011-09-06 10:02:04 +01:00
Richard Hughes
0e0333a6c8 trivial: post release version bump 2011-09-05 13:53:25 +01:00
Richard Hughes
9fc12b37b6 Released UPower 0.9.13 2011-09-05 13:52:05 +01:00
Martin Pitt
75d8c449cd src/linux/integration-test: Fully port to GI
Move from static glib to GI GLib module, to avoid mixing static and dynamic
bindings.

This fixes the tests to work with pygobject 3.
2011-09-05 14:38:31 +02:00
Richard Hughes
bc7ffea5de trivial: fix up a trivial typo in the last commit
Thanks to Emilio López for spotting it!
2011-09-02 09:46:29 +01:00
Diego Elio Pettenò
c08c35f762 build: don't rely on files' presence to define the default backend.
Files might not be there, or in the case of cross-compilation, they most
definitely won't be there (and if they are, they are not the ones you
should be looking for). Instead use the autoconf-defined $host variable to
identify for what system we're building for.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-09-01 12:21:45 +01:00
Denis Washington
785ecbb6d5 Use g_unix_signal_add_full() which has been renamed in the unstable GLib branch
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-08-31 22:43:40 +01:00
Richard Hughes
cb37dcc2e8 Hardcode wacom battery devices as not power-supply devices
We'll switch to a kernel property when the power_supply interface is fixed.
2011-07-19 16:14:20 +01:00
Richard Hughes
b19fca9637 Use git.mk and remove the manual .gitignore files 2011-07-19 12:40:21 +01:00
Javier Jardón
75894ebb2e Use upstream gettext instead the glib one 2011-07-19 12:16:30 +01:00
Javier Jardón
aabd6fb9e3 autogen.sh: Use autoreconf instead custom script 2011-07-19 11:57:50 +01:00
Javier Jardón
5bf494a9d3 configure.ac: Modernize autotools config
Require automake 1.11 as Its needed to generate xz tarballs
Remove unneded macros
2011-07-19 11:57:48 +01:00
Javier Jardón
9e32af9ef6 Avoid warnings about missing annotations
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-07-19 11:55:34 +01:00
Richard Hughes
37bc9a6f8b trivial: post release version bump 2011-07-04 16:47:16 +01:00
Richard Hughes
e3194730b8 Released UPower 0.9.12 2011-07-04 16:46:19 +01:00
Richard Hughes
1f05a6e9b0 Switch to using .xz tarballs 2011-07-04 16:46:00 +01:00
Richard Hughes
2d8358ae4e Fix how we estimate the device rate for batteries that do not provide this data
Based on a patch from Andy Eyre <andrew.eyre@medschool.ox.ac.uk>, many thanks.
2011-07-01 17:14:58 +01:00
Landry Breuil
fed9c33910 Add openbsd missing includes for close() and strcmp() 2011-05-31 11:07:52 +01:00
Landry Breuil
e495d53661 Silence some openbsd warnings about unused vars and bad return values 2011-05-31 11:07:21 +01:00
Landry Breuil
9d40aa4a2d Add AC_PROG_LIBTOOL as advised by autotools 2011-05-31 11:06:31 +01:00
Richard Hughes
390d295b5b trivial: post release version bump 2011-05-25 12:51:33 +01:00
Richard Hughes
d27dd5f4bb Released UPower 0.9.11 2011-05-25 12:50:31 +01:00
Richard Hughes
2b42890480 Only include glib-unix.h if the GLib version is >= 2.29.4
Many thanks to Takahiro HASHIMOTO for debugging the problem. Fixes fdo#37489
2011-05-23 09:42:38 +01:00
Richard Hughes
abfb19d472 Ensure up-apm-native.h gets shipped in the tarball 2011-05-17 08:23:55 +01:00
Martin Pitt
a1fe30811d Linux integration tests: check energy vs. charge
So far the test cases only covered drivers which reported energy (µWh). Add
checks that the Energy* properties are correct, and add a test case for drivers
which report charge (µAh).
2011-05-14 14:39:16 +02:00
Richard Hughes
0fd304c3f3 Add new NotifySleep() and NotifyResume() signals that include the sleep type
This allows session power managers to do different actions depending on whether the user
is suspending or hibernating. This allows the session policy agent to poke other things
(for instance, the screensaver) even if another process initiated the sleep.

This is based on a patch from Phillip Susi <psusi@cfl.rr.com>, many thanks.
2011-05-04 17:57:13 +01:00
Martin Pitt
62024c49c8 Respect $PYTHON for running the test suite
On systems which have an older (< 2.7) Python by default, this allows you to
run make check under PYTHON=python2.7.
2011-05-04 13:46:39 +02:00
Martin Pitt
958bb53105 up-self-test: Run subset of tests when system D-BUS is not available
In restricted environments such as package builds we do not have a system D-BUS
running. In that case, don't just fail, but use the recently introduced
up_daemon_set_bus_type() to run tests on the session D-BUS instead. Run
up-self-tests under dbus-launch for this if available.

Skip tests which need polkit if there is no system D-BUS, as we can't sensibly
run this on the session bus.
2011-05-04 13:42:49 +02:00
Richard Hughes
bdddb74723 trivial: post release version bump 2011-05-03 18:12:48 +01:00
Richard Hughes
5dedd34fe2 Released UPower 0.9.10 2011-05-03 18:11:41 +01:00
Richard Hughes
e9e965590b Use the new threadsafe signal handling support in GLib
If the version of Glib is too old, we continue to use the old non-threadsafe version.
2011-04-28 09:50:51 +01:00
Martin Pitt
5c37df249b trivial: Fix Linux integration test dependency on upowerd
With nested Makefiles we can't depend on a generated file in a different
directory (breaks "make clean && make check"). Thus move the call of the Linux
integration test suite into src/Makefile.am, and only run it if we build the
Linux backend.
2011-04-26 14:31:00 +02:00
Martin Pitt
37fdb2c959 trivial: Fix Linux integration-test for distcheck
distcheck uses a separate build tree, thus call the script from the right
directory. Also actually ship it in release tarballs.
2011-04-26 12:48:23 +02:00
Martin Pitt
065c597b88 Respect $UPOWER_CONF_FILE_NAME in up_config_init()
The daemon test in up-self-test instantiates an UpDaemon object, which creates
an UpConfig object. Unlike UpDaemon itself, up_config_new() did not check for
$UPOWER_CONF_FILE_NAME to find the configuration file name.

This had the effect that a make check/distcheck run would always try to use the
system wide configuration file, and fail if --sysconfdir wasn't specified
appropriately.
2011-04-26 12:44:21 +02:00
Martin Pitt
5cb1f4a9a3 Consider a discharging UPS as "on battery"
Implement get_{on,low}_battery() methods on HID devices for Linux. This will
treat discharging UPSes like batteries and set the "on-battery" and
"on-low-battery" properties accordingly.

This also fixes the test_ups_ac() case in the Linux integration tests.
2011-04-26 11:50:36 +02:00
Martin Pitt
a786d2fd16 Fix "unknown" battery status guessing to not be recursive
Stop querying the global "on-battery" property when trying to guess the status
of a battery which reports as "unknown", as "on-battery" is itself defined in
terms of the states of the individual batteries. Instead, guess the state based
on whether we have any AC available; if so, we can reasonably assume
charging/discharging based on whether any AC is online. If no AC is present,
assume discharging (as we did before), but only if we have only one battery.

Stop guessing for the case where we don't have any AC device, "unknown" battery
state, and multiple batteries, as then we can't know which battery is currently
discharging.

https://bugs.freedesktop.org/show_bug.cgi?id=24371
2011-04-26 11:50:36 +02:00
Martin Pitt
7c617ba6f1 Run Linux integration tests in "make check"
If possible, run the tests under dbus-launch to ensure that there is a private
D-BUS session bus. This allows the tests to work in e. g. a clean package build
environment, and also avoids messing with the real user session bus.
2011-04-26 11:50:36 +02:00