BatteryMonitor: support battery health NOT_AVAILABLE from health status

Battery health is supported but there is not enough information to
determine an accurate value  This is a temporary state.

Bug: 276400004
Test: m
Change-Id: I0d422db20c51ef7e9dc4fa904729beda625c9fea
Signed-off-by: Jack Wu <wjack@google.com>
This commit is contained in:
Jack Wu 2023-04-13 19:37:46 +08:00
parent cf1ca03836
commit cf996f3d8d
2 changed files with 3 additions and 0 deletions

View File

@ -242,6 +242,8 @@ BatteryHealth getBatteryHealthStatus(int status) {
value = BatteryHealth::DEAD;
else if (status == BatteryMonitor::BH_FAILED)
value = BatteryHealth::UNSPECIFIED_FAILURE;
else if (status == BatteryMonitor::BH_NOT_AVAILABLE)
value = BatteryHealth::NOT_AVAILABLE;
else
value = BatteryHealth::UNKNOWN;

View File

@ -62,6 +62,7 @@ class BatteryMonitor {
BH_MARGINAL,
BH_NEEDS_REPLACEMENT,
BH_FAILED,
BH_NOT_AVAILABLE,
};
BatteryMonitor();