summaryrefslogtreecommitdiff
path: root/src/linux
AgeCommit message (Collapse)AuthorFilesLines
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-26daemon: Better timeout source namingBastien Nocera7-10/+30
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-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-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: Fix typos in commentsBastien Nocera1-1/+1
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-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-18linux: Add new definitionsBastien Nocera1-0/+8
Proxy paths, and enumeration from the current API.
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-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: Add GetCriticalAction daemon methodBastien Nocera1-20/+35
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-14daemon: Require newer GLibBastien Nocera5-12/+1
And remove ifdef's.
2013-10-14daemon: Add CriticalPowerActionBastien Nocera2-0/+87
Paraphrasing from the configuration option: The action to take when "TimeAction" or "PercentageAction" above has been reached for the batteries (UPS or laptop batteries) supplying the computer. This is done 20 seconds after the warning-level variable got set to UP_DEVICE_LEVEL_ACTION has been set, to give the opportunity to front-ends to display a (short) warning. This is only implemented for the Linux backend, using logind.
2013-10-14daemon: Replace "on-low-battery" propertyBastien Nocera3-63/+0
With "warning-level" property.
2013-10-14daemon: Remove unneeded reset of priv struct membersBastien Nocera6-13/+0
It's already done by GObject.
2013-10-14Remove obsolete battery recall propertiesBastien Nocera1-13/+0
The recalls for that broken batch of Sony batteries dates back from 2006. All the batteries that could have been recalled have now been recalled, and somebody particularly interested in supporting them can match the batteries using the old rules file, in a user session or a separate daemon.
2013-10-14daemon: Remove obsolete featuresBastien Nocera3-344/+0
2013-10-14daemon: Simplify _new() functionsBastien Nocera1-3/+1
2013-10-14linux: Don't print a warning if the status sysfs attr is missingBastien Nocera1-1/+2
This is the case for some devices like the Wacom wireless (Bluetooth) tablets, and shouldn't produce a warning.
2013-10-14linux: Opt-out of checking Watts Up devices earlierBastien Nocera1-12/+12
Don't wait for tty events from udev if we're not going to use the Watts Up device anyway. Cuts down on the possible wakeups.
2013-10-14linux: Don't guess discharging state for devicesBastien Nocera1-1/+1
If the device state is unknown, don't guess based on the laptop's power supplies (battery/power line) as it might not be charging from there. https://bugs.freedesktop.org/show_bug.cgi?id=70321#c1
2013-10-08Linux integration tests: Fix PEP8 errorsMartin Pitt1-103/+100
2013-10-08Linux integration tests: Fix pyflakes errorsMartin Pitt1-22/+17
Drop a lot of unused variables
2013-10-08Linux integration tests: First test case for libraryMartin Pitt1-0/+21
Start testing the client-side library through gobject-introspection. This covers https://bugs.freedesktop.org/show_bug.cgi?id=70283
2013-09-27linux: Track power_supply devices by name only instead of full sysfs pathMartin Pitt2-8/+14
The full native sysfs path of wireless HID battery devices contains a lot of jitter like USB tree layout or sequence numbers which change after every resume from auto-suspend. Plus, there are kernel bugs which don't give proper remove events for those: http://bugzilla.kernel.org/show_bug.cgi?id=62041 As device names within the same subsystem must be unique anyway, and we only use the device name for constructing the D-BUS object path, only consider the device name for the device list native → upower object lookup table, i. e. in up_native_get_native_path(). This fixes the "A handler is already registered for <battery>" assertion crash if a bluetooth device comes back from auto-suspend. This fixes the test_bluetooth_mouse_reconnect() test case, drop the expected failure. https://launchpad.net/bugs/1112907
2013-09-20Linux integration tests: Test reconnect of bluetooth mouseMartin Pitt1-3/+67
When these power down, we don't get remove uevents for the original power_supply devices from the kernel, but instead we get new devices with a different sequence number, but the same name: UDEV [6408.025124] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:12/0005:0D62:0558.0001/power_supply/hid-00:0f:f6:6d:8e:c0-battery (power_supply) UDEV [23785.90673] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:12/0005:0D62:0558.0002/power_supply/hid-00:0f:f6:6d:8e:c0-battery (power_supply) This circumvents the existing "treating add as change" check (as the native path is different) but breaks later on when building and registering the (supposedly) new object: ERROR **: Failed to register GObject with DBusConnection: org.freedesktop.DBus.Error.ObjectPathInUse A handler is already registered for /org/freedesktop/UPower/devices/mouse_hid_000ff66d8ec0_battery This reproduces https://launchpad.net/bugs/1112907
2013-09-20Linux integration tests: Run tests under umockdev-wrapperMartin Pitt1-1/+5
Don't just cover the test upowerd by umockdev-wrapper, but the test suite itself as well, so that we can send uevents. Do this by re-execing the test suite under umockdev-wrapper if it's not already running under it.