Set to discharging status if charger absent

Set charging status to discharging if charger absent
in case FG report confused status.

Change-Id: I95194b19750eb5af422ebb05f5937ca18a15a61c
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2301533
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Yonghua Yan 2022-06-15 17:50:43 +08:00
commit 7eb1770837

View file

@ -2040,6 +2040,9 @@ static int sgm4154x_charger_get_batt_info(void *data, struct mmi_battery_info *b
if (chg->chg_cfg.full_charged)
chg->batt_info.batt_status = POWER_SUPPLY_STATUS_FULL;
if (!chg->sgm->state.online)
chg->batt_info.batt_status = POWER_SUPPLY_STATUS_DISCHARGING;
memcpy(batt_info, &chg->batt_info, sizeof(struct mmi_battery_info));
if (chg->paired_batt_info.batt_soc == 0 &&
chg->paired_batt_info.batt_mv < EMPTY_BATTERY_VBAT) {