DescriptionImplement device::BatteryStatus support for UPower daemon 0.99.x
The org.freedesktop.UPower API was changed when upgrading the UPower daemon
from version 0.9.23 to 0.99.x. The BatteryStatusManagerLinux used the
"Changed" signal which was replaced by the "PropertyChanged" signal.
Change the BatteryStatusManagerLinux to use the new UPower API
(and keep compatibility with the 0.9.23 version, which is still used in
Ubuntu 14.04 LTS).
1. use dbus::PropertySet: the dbus::PropertySet provides simple access to
the properties and connection to the property-changed notifications.
2. Use UPower method GetDisplayDevice:
The 'DisplayDevice' is a composite battery device. That was added in UPower
version 0.99.0. If we don't get that device or if it is no battery, then we
continue to enumerate all devices.
3. Listen to 'DeviceAdded' and 'DeviceRemoved' signals:
Re-enumerate battery devices if a device is added/removed.
4. Compatibility with UPower version < 0.99
Only old UPower versions need to connect to the 'Changed' signal.
5. Rewrite the existing unittests to use a BatteryStatusManagerLinux instance
with a dbus::MockBus and mock the dbus-methods/properties for the test.
Add more unittests:
- for changing device properties
- for the DisplayDevice
- for enumerating devices
- for the DeviceAdded and DeviceRemoved signals
Committed: https://crrev.com/472a020d5783be9433678edac28953e24e1f5922
Cr-Commit-Position: refs/heads/master@{#413745}
Patch Set 1 #Patch Set 2 : fixup! Implement device::BatteryStatus support for UPower daemon 0.99.x #
Total comments: 27
Patch Set 3 : fixup! Implement device::BatteryStatus support for UPower daemon 0.99.x #Patch Set 4 : fixup! Implement device::BatteryStatus support for UPower daemon 0.99.x #
Total comments: 3
Patch Set 5 : fixup! Implement device::BatteryStatus support for UPower daemon 0.99.x #
Total comments: 4
Patch Set 6 : fixup! Implement device::BatteryStatus support for UPower daemon 0.99.x #Patch Set 7 : Implement device::BatteryStatus support for UPower daemon 0.99.x (squashed) #Patch Set 8 : Implement device::BatteryStatus support for UPower daemon 0.99.x (rebased) #
Messages
Total messages: 24 (7 generated)
|