Fix base::PowerMonitor::IsOnBatteryPower() on OSX and other platforms. |
|||||
Issue descriptionThis method is not implemented on OSX and does not report the initial status correctly on any platform except Windows... but only after a 10 second timer fires to correct the status.
,
Sep 28 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8621728865773df979e061a3b4ab5e6ef80a2cc2 commit 8621728865773df979e061a3b4ab5e6ef80a2cc2 Author: dalecurtis <dalecurtis@chromium.org> Date: Tue Sep 27 21:55:50 2016 Implement base::PowerMonitor::IsOnBatteryPower() for OSX. For whatever reason this was never implemented; this is slimmed down variant of the implementation in devices/battery/. During this process I noticed the initial status for "is on battery power" is incorrect. On Android, ChromeOS the initial state is later supplied by Java and DBus respectively. On Windows it was using a OneShotTimer. This replaces the Windows implementation with a new protected setter which can be used by the device source implementations to set the initial value before a PowerMonitor exists. BUG= 649166 TEST=OSX properly detects battery changes. Initial state correct. Review-Url: https://codereview.chromium.org/2351593004 Cr-Commit-Position: refs/heads/master@{#421350} [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/BUILD.gn [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_device_source.cc [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_device_source.h [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_device_source_android.cc [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_device_source_ios.mm [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_device_source_mac.mm [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_source.cc [modify] https://crrev.com/8621728865773df979e061a3b4ab5e6ef80a2cc2/base/power_monitor/power_monitor_source.h
,
Sep 29 2016
Requesting merge to m54 so that we have accurate watch time graphs for all systems in M54.
,
Sep 29 2016
Your change meets the bar and is auto-approved for M54 (branch: 2840)
,
Sep 29 2016
Merged, but monorail seems to be having a bad day. Hopefully bot will fix it later.
,
Oct 3 2016
This issue has been approved for a merge. Please merge the fix to any appropriate branches as soon as possible! If all merges have been completed, please remove any remaining Merge-Approved labels from this issue. Thanks for your time! To disable nags, add the Disable-Nags label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 3 2016
Confirming that the change is landed. https://chromium.googlesource.com/chromium/src.git/+/dbfd5a68f50540765e6d485322e549a9575386bb Updating labels accordingly.
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dbfd5a68f50540765e6d485322e549a9575386bb commit dbfd5a68f50540765e6d485322e549a9575386bb Author: Dale Curtis <dalecurtis@chromium.org> Date: Thu Sep 29 22:01:14 2016 Merge M54: "Implement base::PowerMonitor::IsOnBatteryPower() for OSX." For whatever reason this was never implemented; this is slimmed down variant of the implementation in devices/battery/. During this process I noticed the initial status for "is on battery power" is incorrect. On Android, ChromeOS the initial state is later supplied by Java and DBus respectively. On Windows it was using a OneShotTimer. This replaces the Windows implementation with a new protected setter which can be used by the device source implementations to set the initial value before a PowerMonitor exists. BUG= 649166 TEST=OSX properly detects battery changes. Initial state correct. Review-Url: https://codereview.chromium.org/2351593004 Cr-Commit-Position: refs/heads/master@{#421350} (cherry picked from commit 8621728865773df979e061a3b4ab5e6ef80a2cc2) Review URL: https://codereview.chromium.org/2379133002 . Cr-Commit-Position: refs/branch-heads/2840@{#587} Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607} [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/BUILD.gn [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_device_source.cc [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_device_source.h [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_device_source_android.cc [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_device_source_ios.mm [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_device_source_mac.mm [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_source.cc [modify] https://crrev.com/dbfd5a68f50540765e6d485322e549a9575386bb/base/power_monitor/power_monitor_source.h |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dalecur...@chromium.org
, Sep 21 2016