mmi_muc_uart: Report Charging

Check the status field on the battery power supply
and then report if charging is occurring.

Change-Id: Iae8a8270264a2ca7d18ea125f95be56c53042554
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1235231
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Kenny Kessler 2018-08-29 14:56:12 -05:00 • committed by Kenneth Kessler
commit 8d1389d574

View file

@ -617,8 +617,10 @@ static int muc_uart_send_power_status(struct mod_muc_data_t *mm_data)
pstatus.battery_max_voltage =
pval.intval > 0 ? (uint32_t)pval.intval : 0;
/* TODO charging set to charger not correct. */
pstatus.charging = pstatus.charger;
if (!power_supply_get_property(mm_data->batt_psy,
POWER_SUPPLY_PROP_STATUS, &pval))
pstatus.charging =
(pval.intval == POWER_SUPPLY_STATUS_CHARGING);
if (!power_supply_get_property(mm_data->usb_psy,
POWER_SUPPLY_PROP_VOLTAGE_MAX, &pval))