summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-09-02linux: Respect the CriticalPowerAction config optionBastien Nocera1-2/+14
It was documented, but the configuration was never actually read. https://bugs.freedesktop.org/show_bug.cgi?id=82925
2014-09-02daemon: Add helper to get string from configBastien Nocera2-0/+12
https://bugs.freedesktop.org/show_bug.cgi?id=82925
2014-09-02Linux integration tests: Split big tests into several smaller onesMartin Pitt1-19/+51
This is better design to catching regressions and problems in a more pin-pointed fashion. This also avoids having to restart the umockdev testbed due to changing the environment variables with stop/start_daemon().
2014-09-02Linux integration tests: Fix error handling for Python 3.4Martin Pitt1-1/+2
Python 3.4 changed the TestCase._outcome semantics, adjust accordingly.
2014-09-02Linux integration tests: Fix crash if there is no session D-BUSMartin Pitt1-1/+4
This can happen in CI environments without a desktop session.
2014-08-18Free the obtained device list array after useAlexander Jesner1-0/+2
Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-07-16self-test: Add missing #includeMartin Pitt1-0/+1
up-self-test.c: In function ‘up_test_history_func’: up-self-test.c:274:2: warning: implicit declaration of function ‘rmdir’ [-Wimplicit-function-declaration] rmdir (history_dir);
2014-07-16Remove polkit testsMartin Pitt2-28/+0
Complete the polkit dependency removal by also dropping it from the self tests. Unbreaks build and up-self-test again.
2014-07-14Remove polkit dependencyEric Koegel6-362/+0
With the removal of the suspend/hibernate code, there's no longer a need for upower to depend on polkit. This patch removes the old polkit code. Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-06-30openbsd: Expose "capacity" and "energy-full-design" propertiesFabian Raetz1-3/+17
https://bugs.freedesktop.org/show_bug.cgi?id=80707
2014-06-24daemon: Fix possible UpHistoryItem leak on failureBastien Nocera1-0/+2
2014-06-24linux: Simplify list freeingBastien Nocera2-4/+2
2014-06-24linux: Fix small memleak on startup with Logitech devicesBastien Nocera1-2/+2
2014-05-07all: Remove IsDocked propertyBastien Nocera2-26/+0
Removes the deprecated (for not very long) property, before we do a 1.0 release. https://bugs.freedesktop.org/show_bug.cgi?id=78380
2014-05-07linux: Remove is_docked from the integration testBastien Nocera1-1/+0
2014-05-07daemon: Deprecate "IsDocked" propertyBastien Nocera7-294/+5
The IsDocked property has been incorrect for a number of laptops for a while, as it thought that laptops with hybrid graphics cards were always docked. The alternative would have been to use the platform/dock_station devices, but those are only exported for ACPI docking stations. Instead, whether an external display is attached (which isn't really docking) should be checked in the same place where the policy depending on the value should be applied, such as gnome-settings-daemon. https://bugs.freedesktop.org/show_bug.cgi?id=36818
2014-04-23daemon: Fix shutdown on boot on some machinesBastien Nocera1-3/+10
On the Lenovo A600 all-in-one, there's a HCI/HID dual-mode Broadcom device which will try to get the battery level of the supplied mouse and keyboard, but will usually fail to do so. So we have a battery of type "battery" (it's not either a mouse or a keyboard, as it's supposed to handle both) but our display device battery code doesn't check whether those batteries are power supplies or not, using this "empty" (0% after the check timed out) battery in the shutdown policy. Check better for power supply devices, not all the "battery" types are power supply batteries, they might be non-power supply ones from unknown device types.
2014-04-22Update lid status when updating ac status.Jasper Lievisse Adriaanse1-2/+68
Signed-off-by: Richard Hughes <richard@hughsie.com>
2014-02-25Create the history directory at runtimeCosimo Cecchi1-1/+3
In addition to build time - this increases compatibilty with OSTree, which starts out with an empty /var. Signed-off-by: Richard Hughes <richard@hughsie.com>
2013-10-29trivial: Fix a compile warning in the linux backendRichard Hughes1-1/+1
2013-10-28linux: Use daemon poll for batteries tooBastien Nocera1-73/+23
This has 2 effects: - we never stop polling (we used to stop polling when the battery was marked as fully-charged, but that can happen when the battery is discharging too) - when in an unknown state, we will poll through the daemon, and through our unknown poll. This isn't a problem as there'll another 115 seconds of wait until we get to poll through the daemon again.
2013-10-28linux: Switch non-battery devices to use the new daemon pollBastien Nocera1-2/+22
Next up is doing this for batteries, which need to switch between a normal/slow poll to a faster one when the battery state is unknown.
2013-10-28linux: Switch Unifying devices to use the new daemon pollBastien Nocera1-9/+2
2013-10-28linux: Switch iDevices to use the new daemon pollBastien Nocera1-22/+2
And remove the gathering of the battery poll from the device itself, it's of nearly no use.
2013-10-28linux: Switch CSR devices to use the new daemon pollBastien Nocera1-7/+2
2013-10-28daemon: Add poll helper functionsBastien Nocera2-0/+140
To be used by all polling backends. This changes the defaults to poll every 120 seconds when a warning level isn't reached, and switch automatically to 30 seconds poll when the battery level is low.
2013-10-26daemon: Better timeout source namingBastien Nocera13-18/+41
Matching the work done in glib, gtk+, etc. This also differentiates the unknown and normal timeouts in the Linux power supply driver.
2013-10-26linux: Add NoPollBatteries configuration optionBastien Nocera1-3/+13
For system integrators. If your firmware is helpful to user space and automatically sends out uevent when the battery level changes (rather than just the battery state) as on most machines, you can enable "NoPollBatteries" in the configuration option, and reduce power consumption from UPower and its listeners.
2013-10-26linux: Split up battery and device refreshBastien Nocera1-7/+7
In up_device_supply_refresh().
2013-10-26linux: Move poll disable to another functionBastien Nocera1-4/+12
2013-10-26linux: Only disable timeouts if ever setBastien Nocera1-5/+5
We cannot ever set the refresh timeout when we have a power line device, so don't try and remove it there.
2013-10-26daemon: Let the backends do the pollingBastien Nocera1-66/+1
When the AC state changes, let the backends poll for battery changes. They know better what's _really_ happening (whether the real state is unknown even if they present a fully-charged battery), etc. This is only possible because we fixed the Linux backend to poll as it should always have.
2013-10-26linux: Poll for unknown state like the daemon didBastien Nocera1-2/+2
5 times, with 1 second timeouts, instead of 30 times, with 2 seconds timeouts.
2013-10-26linux: Fix the "unknown state" heavy pollBastien Nocera1-9/+15
It was never actually setup, as the fallback state was used to check whether we should use poll or not.
2013-10-22linux: Clamp percentage for overfull batteriesMartin Pitt2-0/+37
Some batteries report energy > energy_full and a percentage ("capacity" attribute) > 100%. Clamp these within 0 and 100% for both plausibility as well as to avoid setting an out-of-range property which would then become 0%. https://launchpad.net/bugs/1240673
2013-10-20linux: Fix parsing of double values for certain localesBastien Nocera1-2/+2
I don't think the kernel exports any numbers with a decimal portion, but if they did, they would get the wrong values because some locales use "," as the decimal separator, and not "." as the kernel/C locale would.
2013-10-20daemon: Fix time to empty with multiple batteriesBastien Nocera1-2/+2
If one battery is draining and the other one isn't, the time to empty wouldn't be zero, but it would only match the time to empty for the single battery. Instead, ignore the accumulated time to empty/time to full for multiple batteries and recalculate it. https://bugzilla.gnome.org/show_bug.cgi?id=710344
2013-10-19daemon: Restart upowerd when it crashesBastien Nocera1-0/+1
When UPower crashes, we would never notice the battery going flat because UPower clients aren't polling UPower, so won't autostart it. Instead we rely on systemd to restart us when we crash. libupower-glib also supports the client coming and going. https://bugzilla.gnome.org/show_bug.cgi?id=682912
2013-10-18linux: Finish "fixing" the UPS test caseBastien Nocera1-4/+10
Update the expected warning levels to match, and add a big fat FIXME for the test case itself. That's not how UPSes work, or how UPower is expected to work.
2013-10-18daemon: No warning with no LEDs classBastien Nocera1-1/+2
If there are no LED class devices on the system, no need to print a warning when we cannot open the directory.
2013-10-18daemon: Don't get in a bad state when refresh failsBastien Nocera1-5/+3
Failure to refresh was supposed to be non-fatal, but since we started putting objects on the bus *after* refresh, we were skipping the registration if refresh failed, as is the case in the UPS test case.
2013-10-18daemon: Fix typos in commentsBastien Nocera2-2/+2
2013-10-18linux: More information in the debug outputBastien Nocera1-1/+1
As was the case in other places, we need to be able to differentiate warning messages for them to be useful.
2013-10-18daemon: Differentiate 2 warningsBastien Nocera1-2/+2
No way to know which one was being called otherwise
2013-10-18linux: Fix tests for "OnLowBattery"Bastien Nocera1-23/+23
Replace them all with WarningLevel tests. Note we current crash when adding a UPS, in test_ups_ac.
2013-10-18linux: Add TODO item for the GetCriticalAction bindingBastien Nocera1-0/+2
2013-10-18linux: get_properties_sync() doesn't exist anymoreBastien Nocera1-1/+0
2013-10-18linux: Add helper to get DisplayDevice propertyBastien Nocera1-0/+8
In the integration tests.
2013-10-18daemon: Fix WarningLevel for devices with no "time to empty"Bastien Nocera1-1/+3
As can happen with missing metadata, we might not have a time to empty, so rely on the percentage instead.
2013-10-18daemon: Add small doc update_warning_levelBastien Nocera1-0/+2