summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorjennyz@google.com <jennyz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 22:18:34 +0000
committerjennyz@google.com <jennyz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 22:18:34 +0000
commitb16fd5d45dca1017d6410d3fae7eac15194ed6ab (patch)
tree94d9ef2206a0c9d5c95080183143e0fc61287237 /ash
parent52ada5aad2feb0f6bb2a4e80cfd6e9ee48f3fe58 (diff)
downloadchromium_src-b16fd5d45dca1017d6410d3fae7eac15194ed6ab.zip
chromium_src-b16fd5d45dca1017d6410d3fae7eac15194ed6ab.tar.gz
chromium_src-b16fd5d45dca1017d6410d3fae7eac15194ed6ab.tar.bz2
Work around the crOS battery time reporting issue crosbug.com/31633 in ash tray battery UI.
BUG=127771 TEST=battery time displayed on ash tray bubble settings row does not contain garbage time when user switch log in state. Review URL: https://chromiumcodereview.appspot.com/10535118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/system/power/power_status_view.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ash/system/power/power_status_view.cc b/ash/system/power/power_status_view.cc
index cd47f71..05f318b 100644
--- a/ash/system/power/power_status_view.cc
+++ b/ash/system/power/power_status_view.cc
@@ -87,8 +87,14 @@ void PowerStatusView::UpdateTextForDefaultView() {
int hour = 0;
int min = 0;
if (!supply_status_.is_calculating_battery_time) {
+ // TODO(jennyz): Due to crosbug.com/31633, averaged_battery_time_to_empty
+ // from PowerSupplyStatus object can contain garbage data for the first
+ // call in a crOS session. Until this bug is fixed, use
+ // supply_status_.battery_seconds_to_empty to render battery time.
+ // Change back to use averaged_battery_time_to_empty to display in UI
+ // once crosbug.com/31633 is fixed.
base::TimeDelta time = base::TimeDelta::FromSeconds(
- supply_status_.averaged_battery_time_to_empty);
+ supply_status_.battery_seconds_to_empty);
hour = time.InHours();
min = (time - base::TimeDelta::FromHours(hour)).InMinutes();
}