AgeCommit message (Collapse)AuthorFilesLines
2012-06-27trivial: Fix up some documentation typosLukas Tinkl1-4/+4
Signed-off-by: Richard Hughes <>
2012-06-27openbsd: Properly initialize update-time when creating devicesLandry Breuil1-0/+4
Signed-off-by: Richard Hughes <>
2012-06-25trivial: post release version bumpRichard Hughes2-5/+5
2012-06-25Released UPower 0.9.17UPOWER_0_9_17Richard Hughes1-0/+17
2012-06-18linux: Remove obsolete check for magicmouse_ and duplicated wacom_ checksDaniel Nicoletti1-4/+1
Signed-off-by: Richard Hughes <>
2012-06-18linux: Don't allow non-power-supply devices to set the OnBattery propertyDaniel Nicoletti1-0/+4
Signed-off-by: Richard Hughes <>
2012-06-14Fix wrong PowerSupply property for devices without a scope sysfs attributeMartin Pitt1-2/+2
Fix NULL pointer comparison in up_device_supply_coldplug(). This caused (lt-upowerd:5754): GLib-CRITICAL **: g_ascii_strcasecmp: assertion `s1 != NULL' failed when a device does not have a "scope" sysfs attribute, and erroneously considering that device to not power the system.
2012-06-14integration-test: fail on CRITICALsMartin Pitt1-1/+11
Crash the daemon on any CRITICAL message, and also set WARNING and CRITICAL messages to be fatal on the client side. On the server side we might have some legitimate warnings, such as failing to load the config file from /usr/local/etc (if you build a tree without passing correct --sysconfdir options, etc.). This exposes the current CRITICAL the daemon raises at startup. As with that the daemon never starts up, fix the "wait for the daemon" loop to time out after 10 seconds.
2012-06-14Selectively disable warnings for deprecated GValueArrayMartin Pitt2-0/+12
GLib 2.33 and further deprecates GValueArray. However, we still need it as long as we are using dbus-glib, so selectively disable the deprecation warnings for the three functions that use GValueArray. This allows us to continue to build with -Werror.
2012-05-30Drop 'type' parameter from CancelRequest() signatureSascha Silbe1-8/+0
CancelRequest() never worked because the method signature in D-Bus introspection data didn't match the actual function signature. Since the 'type' parameter isn't needed by the implementation (cookies are unique across all requests, not just requests of a certain type), we drop it from the public API. This makes it easier for clients to use the API as they only have to remember the cookie, not both cookie and type. Since it never worked in the first place, there are no backwards compatibility issues. Signed-off-by: Richard Hughes <>
2012-05-30Fix use-after-free of qos itemSascha Silbe1-2/+6
up_qos_init() registers a destroyer callback for the qos item array, so the current item will be gone after the calls to g_ptr_array_remove(). By storing the item kind in a local variable we can pass it to up_qos_latency_perhaps_changed() later. Delaying the removal from the array is not an option as up_qos_latency_perhaps_changed() scans that array to re-evaluate the target latency. Signed-off-by: Richard Hughes <>
2012-05-30linux: Treat the battery state 'not charging' as PENDING_CHARGERichard Hughes1-0/+2
2012-05-22Fix the LatencyChanged signalSascha Silbe1-1/+1
The type of the 'value' parameter of the LatencyChanged signal is integer, not boolean. Fixing this causes the signal to actually be emitted. Signed-off-by: Richard Hughes <>
2012-04-30trivial: post release version bumpRichard Hughes2-5/+5
2012-04-30Released UPower 0.9.16UPOWER_0_9_16Richard Hughes3-3/+26
2012-04-27Correct the cap on the energy rateGary Ching-Pang Lin1-1/+1
Signed-off-by: Richard Hughes <>
2012-04-26libupower-glib: fix small memory leakPavel Vasin1-0/+1
Signed-off-by: Richard Hughes <>
2012-04-18Never detect HID devices with batteries as power suppliesRichard Hughes1-2/+12
Some HID devices with batteries (like bluetooth keyboards) have been creating power supply devices in sysfs since Linux 3.3. UPower thinks that they are system devices and shuts down the system if they get low. This is bad. This is fixed in Linux 3.4, where there is a new 'scope' file that defines if the device is powering the system. Helpfully ACPI batteries don't populate the scope value, but soon will. Add support for the scope attribute now, and default to system devices if it's missing. Note, you need to be running a 3.4 kernel or a 3.3 with the patch backported for this to work. Resolves:
2012-04-11Re-coldplug dock status when resuming from sleepEvan Broder1-0/+17
It's possible for the docked state of a laptop (i.e. the display connectivity state) to change while the laptop is asleep. Signed-off-by: Evan Broder <> Signed-off-by: Richard Hughes <>
2012-04-03Fix crash in up_device_csr_finalize()Martin Pitt1-1/+1
Commit 46f1c7f0283 has a typo which prevents the fix from actually working.
2012-02-17Clamp the UPS percentage from 0 to 100 to fix syslog spamRichard Hughes1-1/+1
This device bug seems to happen with CPS UPS units.
2012-01-18Return all history records for a timespan of zeroRichard Hughes1-1/+7
This makes the code conform to the documentation.
2012-01-18Do not print error message for missing /etc/crypttab.Kelly Anderson1-1/+3
Signed-off-by: Richard Hughes <>
2012-01-17Install a systemd service file if systemd is usedBenedikt Morbach5-8/+45
This makes dbus defer starting upowerd to systemd instead of doing it itself and thus puts the daemon under proper systemd supervision. Signed-off-by: Richard Hughes <>
2012-01-11libupower-glib: srcdir != builddir fixRyan Lortie1-0/+1
2012-01-06Add boolean RunPowersaveCommand to UPower.confLandry Breuil2-2/+14
Defaulting to true, it controls whether we want the powersave commands to be run when running on battery/plugging ac. Signed-off-by: Richard Hughes <>
2012-01-06openbsd: set powersave command to apm -C/-ALandry Breuil1-1/+5
Signed-off-by: Richard Hughes <>
2012-01-06openbsd: no need to pass the fd aroundLandry Breuil1-9/+6
better access it where needed through the singleton. Signed-off-by: Richard Hughes <>
2012-01-06openbsd: handle case where minutes_left might be negativeLandry Breuil1-2/+2
might not be useful since apm_fd is accessed through the singleton.. Signed-off-by: Richard Hughes <>
2012-01-06openbsd: improve logic wrt sensor typeLandry Breuil1-15/+5
in case some sensors are in AMPHOUR/AMPS and others in WATTHOUR/WATTS, don't assume they are all the same type. As a benefit, shrinks the code a bit. Signed-off-by: Richard Hughes <>
2012-01-06openbsd: fix energy-rate calculationLandry Breuil1-3/+5
since acpibat.c r1.59, bst_rate type is SENSOR_AMPS or SENSOR_WATTS and value has been corrected. Tweak accordingly. Signed-off-by: Richard Hughes <>
2012-01-06openbsd: use a singleton pattern to access /dev/apmLandry Breuil3-23/+22
up_apm_get_fd() opens /dev/apm only if it's not already opened. Signed-off-by: Richard Hughes <>
2012-01-06openbsd: Fix history by not trying to refresh if /dev/apm wasn't opened yetLandry Breuil1-2/+5
Signed-off-by: Richard Hughes <>
2011-12-05trivial: post release version bumpRichard Hughes2-5/+5
2011-12-05Released UPower 0.9.15UPOWER_0_9_15Richard Hughes1-0/+19
2011-12-05src/linux/integration-test: Fail gracefully if GI is not availableMartin Pitt1-2/+6
2011-12-05Fix invocation of src/linux/integration-testMartin Pitt1-1/+1
In "check", do not call the test suite through "python". Just call it directly and let the hashbang take care of the interpreter.
2011-12-05Revert "src/linux/integration-test: Do not crash on absent ↵Martin Pitt1-12/+5
_outcomeForDoCleanups" This reverts commit 14761c09d27934188829e3c804aca6593757ed9b. The real reason for the failure is that calls the script with "python" which is Python 2, but we need Python 3.
2011-12-05src/linux/integration-test: Do not crash on absent _outcomeForDoCleanupsMartin Pitt1-5/+12
unittest.TestCase unfortunately does not have any public API to check whether a test case succeeded, so we use the private self._outcomeForDoCleanups. This does not seem to exist every time, so avoid a crash if it doesn't.
2011-12-03upower: Handle Linux power supplies not exporting a present propertyHeiko Stübner1-1/+6
According to Anton Vorontsov (Linux power supply maintainer) power supplies should not export a present property when they are not hotpluggable and users of the properties should handle supplies without present-property as always present. This patch implements this feature using an additional sysfs_file_exists call before sysfs_get_bool. Signed-off-by: Richard Hughes <>
2011-11-29trivial: USB devices are assumed to be 5VRichard Hughes1-0/+9
2011-11-29trivial: fix the name of the percentage fileRichard Hughes1-1/+1
2011-11-29Don't assert when the power_supply device type is usbRichard Hughes1-4/+1
2011-11-29Move the wacom hack to allow us to support other types of USB deviceRichard Hughes1-26/+17
2011-11-29If a power-supply device doesn't report charge or energy, try to read the ↵Richard Hughes1-1/+8
2011-11-11Fix crash in up_device_csr_finalize()Martin Pitt1-1/+2
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-11src/linux/integration-test: Port to Python 3Martin Pitt1-7/+8
2011-10-19Use linear regression to get better predicted battery timesLeonardo Robol1-24/+99
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 <>
2011-10-06Don't spam the log when we're saving history when on low powerRichard Hughes2-6/+1
2011-10-04Add --with-historydir to specify where we want the history files to be storedLandry Breuil3-2/+13
Signed-off-by: Richard Hughes <>