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:
commit
eb9d901dfd
4 changed files with 7 additions and 1 deletions
|
@ -37,6 +37,7 @@ parcelable HealthInfo {
|
|||
boolean chargerAcOnline;
|
||||
boolean chargerUsbOnline;
|
||||
boolean chargerWirelessOnline;
|
||||
boolean chargerDockOnline;
|
||||
int maxChargingCurrentMicroamps;
|
||||
int maxChargingVoltageMicrovolts;
|
||||
android.hardware.health.BatteryStatus batteryStatus;
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue