Merge "health: support Dock charging" am: a366ec1a33 am: 3ab4cb982d

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1946230

Change-Id: I3e3509265ebe538804bf2d3137071542a3930f4a
This commit is contained in:
Treehugger Robot 2022-01-25 02:30:28 +00:00 committed by Automerger Merge Worker
commit eb9d901dfd
4 changed files with 7 additions and 1 deletions

View file

@ -37,6 +37,7 @@ parcelable HealthInfo {
boolean chargerAcOnline;
boolean chargerUsbOnline;
boolean chargerWirelessOnline;
boolean chargerDockOnline;
int maxChargingCurrentMicroamps;
int maxChargingVoltageMicrovolts;
android.hardware.health.BatteryStatus batteryStatus;

View file

@ -39,6 +39,10 @@ parcelable HealthInfo {
* Wireless charger state - 'true' if online
*/
boolean chargerWirelessOnline;
/**
* Dock charger state - 'true' if online
*/
boolean chargerDockOnline;
/**
* Maximum charging current supported by charger in µA
*/

View file

@ -61,7 +61,7 @@ void HalHealthLoop::OnHealthInfoChanged(const HealthInfo& health_info) {
void HalHealthLoop::set_charger_online(const HealthInfo& health_info) {
charger_online_ = health_info.chargerAcOnline || health_info.chargerUsbOnline ||
health_info.chargerWirelessOnline;
health_info.chargerWirelessOnline || health_info.chargerDockOnline;
}
} // namespace aidl::android::hardware::health

View file

@ -22,6 +22,7 @@ void convert(const HealthInfo& info, struct ::android::BatteryProperties* p) {
p->chargerAcOnline = info.chargerAcOnline;
p->chargerUsbOnline = info.chargerUsbOnline;
p->chargerWirelessOnline = info.chargerWirelessOnline;
p->chargerDockOnline = info.chargerDockOnline;
p->maxChargingCurrent = info.maxChargingCurrentMicroamps;
p->maxChargingVoltage = info.maxChargingVoltageMicrovolts;
p->batteryStatus = static_cast<int>(info.batteryStatus);