From f7ae91a5902e9da49c7e648630583374bec92cde Mon Sep 17 00:00:00 2001 From: Kevin K Wong Date: Mon, 7 Mar 2016 16:06:12 -0800 Subject: [PATCH] charger_state_v2: force static battery info update on battery change BUG=none BRANCH=none TEST=on system which has different static battery info based on battery present, when the present status has changed, verify the battery info is also changed. Change-Id: Id58c545e3315dc63c6dd6b59141b6302d767bfb7 Signed-off-by: Kevin K Wong Reviewed-on: https://chromium-review.googlesource.com/331655 Reviewed-by: Li1 Feng Reviewed-by: Shawn N --- common/charge_state_v2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 0159a54207..1fc4f7ff02 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -649,6 +649,11 @@ void charger_task(void) if (prev_bp != curr.batt.is_present) { prev_bp = curr.batt.is_present; + + /* Update battery info due to change of battery */ + batt_info = battery_get_info(); + need_static = 1; + curr.desired_input_current = get_desired_input_current(prev_bp, info); charger_set_input_current(curr.desired_input_current);