summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
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
2013-10-18linux: Add new definitionsBastien Nocera1-0/+8
Proxy paths, and enumeration from the current API.
2013-10-18linux: Fix UMockdev typelib not being foundBastien Nocera1-1/+1
The Makefile rule was using GI_REPOSITORY_PATH instead of GI_TYPELIB_PATH meaning that if a custom typelib path was needed (jhbuild for example) it wouldn't be found.
2013-10-18linux: Mark devices with 100% battery as fullBastien Nocera1-0/+5
2013-10-18linux: Fix Bluetooth devices appearing with 0% batteryBastien Nocera1-1/+7
When switching off Bluetooth devices, and before they timeout, we won't be able to read the battery percentage, so don't overwrite the previous value with "0%", but set the state to unknown instead. https://bugs.freedesktop.org/show_bug.cgi?id=70325
2013-10-18linux: Add a way to check when sysfs_get_double failsBastien Nocera2-0/+20
2013-10-18linux: Use up_device_supply_get_string()Bastien Nocera1-5/+6
In up_device_supply_get_state()
2013-10-18linux: Add a simpler, quicker path for devicesBastien Nocera1-1/+66
When refreshing the state of device batteries, no need to get data that won't be there anyway, such as voltage, temperature, or consumption rate. This avoids warnings about voltage being unknown for devices, and cuts down on the properties churn.
2013-10-18linux: Split off device state retrievalBastien Nocera1-20/+31
We're going to be reusing this elsewhere.
2013-10-18linux: Ignore ACs coming from devicesBastien Nocera1-0/+7
We already have enough information on the device battery. This avoids having a device for the wacom AC which we won't use.
2013-10-18linux: Remove incorrect statementBastien Nocera1-1/+0
Not all "UpDeviceSupply" actually supply power to the computer.
2013-10-17daemon: Fix crash when device is removedBastien Nocera1-0/+2
When the device was removed, we forgot to cancel sending out changed properties, causing illegal memory accesses.
2013-10-17daemon: Remove dead code from up_daemon_device_changed_cb()Bastien Nocera1-11/+0
2013-10-17linux: Use boolean values in sysfs_get_bool, not intBastien Nocera1-4/+3
2013-10-17linux: Remove unused sysfs utils functionsBastien Nocera2-110/+0
2013-10-17linux: Remove debugBastien Nocera1-1/+0
2013-10-17all: Remove *changed signalsBastien Nocera4-84/+2
Now that we send out PropertiesChanged signals (on the daemon side) and "notify" signals (on the client side), there's no need for the all encompassing DeviceChanged and Changed signals. They would have woken up any client, even if they were not interested in receiving the signals.
2013-10-17power: Work-around batteries that are slow to notice chargeBastien Nocera1-0/+5
This is a hack that was in gnome-settings-daemon's power plugin. We would check whether we were on AC before saying for certain that batteries had a low-level, and raising the warning-level.
2013-10-17all: Add GetCriticalAction daemon methodBastien Nocera8-20/+115
This allows desktop front-ends to get which action will actually be taken when we hit critical battery. This is not a property as availability of actions might change over the course of the run of the system, and we didn't want to make unnecessary D-Bus calls on startup.
2013-10-17linux: Fix incorrect check for logind sleep methodsBastien Nocera1-1/+1
A simple reversed check...
2013-10-17daemon: Make warning-level UpDevice property writableBastien Nocera1-1/+4
So we can update the display device warning level.
2013-10-17all: Remove WarningLevel from the daemon propertiesBastien Nocera2-22/+1
The WarningLevel property just replicated the warning level on the display device, or at least should have. So we fix the latter to remove the former.
2013-10-17daemon: Indentation in UpDaemon structBastien Nocera1-9/+9
2013-10-16daemon: Add documentation for computed propertiesBastien Nocera1-0/+6
Those are also part of the display device properties that we will update.
2013-10-16daemon: Mention hard-coded display device object pathBastien Nocera1-1/+3
/org/freedesktop/UPower/devices/DisplayDevice is a stable object path.
2013-10-16daemon: Minimise WarningLevel signalsBastien Nocera1-0/+4
When it doesn't actually change, don't send out signals.
2013-10-16daemon: Fix sending device's PropertiesChanged signalBastien Nocera1-1/+1
The interface name was missing ".Device" at the end, so wasn't getting registered by clients.
2013-10-16daemon: Emit PropertiesChanged for computed properties tooBastien Nocera1-2/+10
The IconName and WarningLevel properties were not sent out through PropertiesChanged when they changed for devices.