Commit 7027a746 authored by Joon Ahn's avatar Joon Ahn Committed by Chromium LUCI CQ

diagnostics: update battery health to report 0~100 instead of 0~1

Bug: 1125150
Change-Id: Ic34f9545bceb90c6a2a0f8a63c0914a49870ca88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2572678Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Joon Ahn <joonbug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833482}
parent 5c5f62bf
...@@ -142,7 +142,7 @@ void PopulateBatteryHealth(const healthd::BatteryInfo& battery_info, ...@@ -142,7 +142,7 @@ void PopulateBatteryHealth(const healthd::BatteryInfo& battery_info,
battery_info.charge_full_design * kMilliampsInAnAmp; battery_info.charge_full_design * kMilliampsInAnAmp;
out_battery_health.cycle_count = battery_info.cycle_count; out_battery_health.cycle_count = battery_info.cycle_count;
out_battery_health.battery_wear_percentage = out_battery_health.battery_wear_percentage =
out_battery_health.charge_full_now_milliamp_hours / 100 * out_battery_health.charge_full_now_milliamp_hours /
out_battery_health.charge_full_design_milliamp_hours; out_battery_health.charge_full_design_milliamp_hours;
} }
......
...@@ -384,7 +384,7 @@ void VerifyHealthResult(const mojom::BatteryHealthPtr& update, ...@@ -384,7 +384,7 @@ void VerifyHealthResult(const mojom::BatteryHealthPtr& update,
const int32_t expected_charge_full_design_milliamp_hours = const int32_t expected_charge_full_design_milliamp_hours =
charge_full_design * 1000; charge_full_design * 1000;
const int8_t expected_battery_wear_percentage = const int8_t expected_battery_wear_percentage =
expected_charge_full_now_milliamp_hours / 100 * expected_charge_full_now_milliamp_hours /
expected_charge_full_design_milliamp_hours; expected_charge_full_design_milliamp_hours;
EXPECT_EQ(expected_charge_full_now_milliamp_hours, EXPECT_EQ(expected_charge_full_now_milliamp_hours,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment