health: support Dock charging
Bug: 194012532 Test: Show dock type correctly Signed-off-by: Jack Wu <wjack@google.com> Change-Id: I6031d4c12a89317fdf98894ff4bec1cfc5dcfddf
This commit is contained in:
parent
ac91c7c9dd
commit
5b13512b89
4 changed files with 7 additions and 1 deletions
|
@ -37,6 +37,7 @@ parcelable HealthInfo {
|
||||||
boolean chargerAcOnline;
|
boolean chargerAcOnline;
|
||||||
boolean chargerUsbOnline;
|
boolean chargerUsbOnline;
|
||||||
boolean chargerWirelessOnline;
|
boolean chargerWirelessOnline;
|
||||||
|
boolean chargerDockOnline;
|
||||||
int maxChargingCurrentMicroamps;
|
int maxChargingCurrentMicroamps;
|
||||||
int maxChargingVoltageMicrovolts;
|
int maxChargingVoltageMicrovolts;
|
||||||
android.hardware.health.BatteryStatus batteryStatus;
|
android.hardware.health.BatteryStatus batteryStatus;
|
||||||
|
|
|
@ -39,6 +39,10 @@ parcelable HealthInfo {
|
||||||
* Wireless charger state - 'true' if online
|
* Wireless charger state - 'true' if online
|
||||||
*/
|
*/
|
||||||
boolean chargerWirelessOnline;
|
boolean chargerWirelessOnline;
|
||||||
|
/**
|
||||||
|
* Dock charger state - 'true' if online
|
||||||
|
*/
|
||||||
|
boolean chargerDockOnline;
|
||||||
/**
|
/**
|
||||||
* Maximum charging current supported by charger in µA
|
* Maximum charging current supported by charger in µA
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -61,7 +61,7 @@ void HalHealthLoop::OnHealthInfoChanged(const HealthInfo& health_info) {
|
||||||
|
|
||||||
void HalHealthLoop::set_charger_online(const HealthInfo& health_info) {
|
void HalHealthLoop::set_charger_online(const HealthInfo& health_info) {
|
||||||
charger_online_ = health_info.chargerAcOnline || health_info.chargerUsbOnline ||
|
charger_online_ = health_info.chargerAcOnline || health_info.chargerUsbOnline ||
|
||||||
health_info.chargerWirelessOnline;
|
health_info.chargerWirelessOnline || health_info.chargerDockOnline;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace aidl::android::hardware::health
|
} // namespace aidl::android::hardware::health
|
||||||
|
|
|
@ -22,6 +22,7 @@ void convert(const HealthInfo& info, struct ::android::BatteryProperties* p) {
|
||||||
p->chargerAcOnline = info.chargerAcOnline;
|
p->chargerAcOnline = info.chargerAcOnline;
|
||||||
p->chargerUsbOnline = info.chargerUsbOnline;
|
p->chargerUsbOnline = info.chargerUsbOnline;
|
||||||
p->chargerWirelessOnline = info.chargerWirelessOnline;
|
p->chargerWirelessOnline = info.chargerWirelessOnline;
|
||||||
|
p->chargerDockOnline = info.chargerDockOnline;
|
||||||
p->maxChargingCurrent = info.maxChargingCurrentMicroamps;
|
p->maxChargingCurrent = info.maxChargingCurrentMicroamps;
|
||||||
p->maxChargingVoltage = info.maxChargingVoltageMicrovolts;
|
p->maxChargingVoltage = info.maxChargingVoltageMicrovolts;
|
||||||
p->batteryStatus = static_cast<int>(info.batteryStatus);
|
p->batteryStatus = static_cast<int>(info.batteryStatus);
|
||||||
|
|
Loading…
Reference in a new issue