Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Issue 2066503002: Implement device::BatteryStatus support for UPower daemon 0.99.x (Closed)

Created:
4 years, 6 months ago by markuso
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement 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) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1691 lines, -289 lines) Patch
M device/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M device/battery/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M device/battery/battery.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M device/battery/battery_status_manager_linux.h View 1 2 3 2 chunks +48 lines, -7 lines 0 comments Download
M device/battery/battery_status_manager_linux.cc View 1 2 3 4 5 5 chunks +471 lines, -222 lines 0 comments Download
A device/battery/battery_status_manager_linux-inl.h View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
M device/battery/battery_status_manager_linux_unittest.cc View 1 2 3 4 5 10 chunks +1135 lines, -57 lines 0 comments Download
M device/device_tests.gyp View 1 2 3 4 5 6 7 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 24 (7 generated)
markuso
@reviewer: does this patch look OK to you? I tested this both on Ubuntu 16.04, ...
4 years, 6 months ago (2016-06-13 12:40:32 UTC) #3
timvolodine
@markuso: From my first scan looks reasonable to me see comments below. It's quite a ...
4 years, 6 months ago (2016-06-16 16:12:24 UTC) #4
markuso
> Also, could you kick-off the try-bots please to see that nothing fails.. It seems ...
4 years, 6 months ago (2016-06-17 08:44:28 UTC) #5
markuso
https://codereview.chromium.org/2066503002/diff/20001/device/battery/battery_status_manager_linux.cc File device/battery/battery_status_manager_linux.cc (right): https://codereview.chromium.org/2066503002/diff/20001/device/battery/battery_status_manager_linux.cc#newcode55 device/battery/battery_status_manager_linux.cc:55: base::Version daemon_version(); On 2016/06/16 16:12:24, timvolodine wrote: > const? ...
4 years, 6 months ago (2016-06-17 08:45:20 UTC) #6
markuso
https://codereview.chromium.org/2066503002/diff/20001/device/battery/battery_status_manager_linux_unittest.cc File device/battery/battery_status_manager_linux_unittest.cc (right): https://codereview.chromium.org/2066503002/diff/20001/device/battery/battery_status_manager_linux_unittest.cc#newcode31 device/battery/battery_status_manager_linux_unittest.cc:31: const char kUPowerInterfaceName[] = "org.freedesktop.UPower"; On 2016/06/17 08:45:19, markuso ...
4 years, 6 months ago (2016-06-17 10:01:17 UTC) #7
markuso
I think I have either answered all questions or provided a fix for the issues ...
4 years, 5 months ago (2016-07-01 08:42:08 UTC) #8
timvolodine
yes thanks markuso@, appreciate your work! sorry for the delay, got pulled into other things.. ...
4 years, 5 months ago (2016-07-05 16:21:07 UTC) #9
timvolodine
also given the size of this patch maybe good if a second reviewer took a ...
4 years, 5 months ago (2016-07-05 16:26:39 UTC) #11
Ken Rockot(use gerrit already)
lgtm just some nits I didn't thoroughly review all the logic in the tests https://codereview.chromium.org/2066503002/diff/60001/device/battery/battery_status_manager_linux-inl.h ...
4 years, 5 months ago (2016-07-10 14:57:15 UTC) #12
markuso
On 2016/07/05 16:21:07, timvolodine wrote: > did you get the chance to test it on ...
4 years, 5 months ago (2016-07-21 12:38:12 UTC) #13
markuso
https://codereview.chromium.org/2066503002/diff/20001/device/battery/battery_status_manager_linux.cc File device/battery/battery_status_manager_linux.cc (right): https://codereview.chromium.org/2066503002/diff/20001/device/battery/battery_status_manager_linux.cc#newcode475 device/battery/battery_status_manager_linux.cc:475: bool success) {} On 2016/07/05 16:21:07, timvolodine wrote: > ...
4 years, 5 months ago (2016-07-21 12:39:31 UTC) #14
markuso
Finally I had the time to test all the changes on a laptop that has ...
4 years, 4 months ago (2016-08-19 12:02:51 UTC) #15
timvolodine
On 2016/08/19 12:02:51, markuso wrote: > Finally I had the time to test all the ...
4 years, 4 months ago (2016-08-19 16:18:32 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2066503002/140001
4 years, 4 months ago (2016-08-23 13:12:36 UTC) #19
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 4 months ago (2016-08-23 15:49:28 UTC) #21
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/472a020d5783be9433678edac28953e24e1f5922 Cr-Commit-Position: refs/heads/master@{#413745}
4 years, 4 months ago (2016-08-23 15:51:25 UTC) #23
timvolodine
4 years, 3 months ago (2016-09-19 18:38:12 UTC) #24
Message was sent while issue was closed.
retrospective update: this was lgtm.

Powered by Google App Engine
This is Rietveld 408576698