New issue
Advanced search Search tips

Issue 649166 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 633743



Sign in to add a comment

Fix base::PowerMonitor::IsOnBatteryPower() on OSX and other platforms.

Project Member Reported by dalecur...@chromium.org, Sep 21 2016

Issue description

This 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.
 
Components: Internals>Media
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Labels: Merge-Request-54
Requesting merge to m54 so that we have accurate watch time graphs for all systems in M54.

Comment 4 by dimu@chromium.org, Sep 29 2016

Labels: -Merge-Request-54 Merge-Approved-54 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M54 (branch: 2840)
Status: Fixed (was: Started)
Merged, but monorail seems to be having a bad day. Hopefully bot will fix it later.
Project Member

Comment 6 by sheriffbot@chromium.org, 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
Labels: -Merge-Approved-54 merge-merged-2840
Confirming that the change is landed.
https://chromium.googlesource.com/chromium/src.git/+/dbfd5a68f50540765e6d485322e549a9575386bb

Updating labels accordingly.
Project Member

Comment 8 by bugdroid1@chromium.org, 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