From 8231c3fe2da24bacdeb0d38edecd99aa098fa34c Mon Sep 17 00:00:00 2001 From: Jack Wu Date: Fri, 19 May 2023 14:31:53 +0800 Subject: [PATCH] BatteryMonitor: support battery health INCONSISTENT from health status Report Battery health INCONSISTENT when there is a battery recalibration pending. Bug: 283182048 Test: m Change-Id: I8b944ddac7cc919fc95b1b71b015101642a62f96 Signed-off-by: Jack Wu --- healthd/BatteryMonitor.cpp | 2 ++ healthd/include/healthd/BatteryMonitor.h | 1 + 2 files changed, 3 insertions(+) diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index f68d65a54..bd7955a7f 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -244,6 +244,8 @@ BatteryHealth getBatteryHealthStatus(int status) { value = BatteryHealth::UNSPECIFIED_FAILURE; else if (status == BatteryMonitor::BH_NOT_AVAILABLE) value = BatteryHealth::NOT_AVAILABLE; + else if (status == BatteryMonitor::BH_INCONSISTENT) + value = BatteryHealth::INCONSISTENT; else value = BatteryHealth::UNKNOWN; diff --git a/healthd/include/healthd/BatteryMonitor.h b/healthd/include/healthd/BatteryMonitor.h index a4c013b86..e9998ba7a 100644 --- a/healthd/include/healthd/BatteryMonitor.h +++ b/healthd/include/healthd/BatteryMonitor.h @@ -63,6 +63,7 @@ class BatteryMonitor { BH_NEEDS_REPLACEMENT, BH_FAILED, BH_NOT_AVAILABLE, + BH_INCONSISTENT, }; BatteryMonitor();