diff options
author | Johan Redestig <johan.redestig@sonymobile.com> | 2016-02-03 13:45:54 +0100 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonymobile.com> | 2016-02-03 13:45:54 +0100 |
commit | 3282861b68978abbbacb9b7dce260f70f9695187 (patch) | |
tree | a4c718ae919c8b2d46dce9a793d08ad9b98ae6b7 /healthd | |
parent | f330e5462d200080d1694834282afadc018060e1 (diff) | |
download | core-3282861b68978abbbacb9b7dce260f70f9695187.tar.gz core-3282861b68978abbbacb9b7dce260f70f9695187.tar.bz2 core-3282861b68978abbbacb9b7dce260f70f9695187.zip |
Add support for USB_HVDCP chargers
and print a warning message containing the type
when the battery monitor fails to recognize a power supply.
Change-Id: I02ebd89736f7444f8bf7f28550afeec82d57e107
Diffstat (limited to 'healthd')
-rw-r--r-- | healthd/BatteryMonitor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index cdfe9c573..8f98f1734 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -134,6 +134,7 @@ BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String { "Mains", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB", ANDROID_POWER_SUPPLY_TYPE_USB }, { "USB_DCP", ANDROID_POWER_SUPPLY_TYPE_AC }, + { "USB_HVDCP", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_CDP", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_ACA", ANDROID_POWER_SUPPLY_TYPE_AC }, { "USB_C", ANDROID_POWER_SUPPLY_TYPE_AC }, @@ -147,8 +148,10 @@ BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String return ANDROID_POWER_SUPPLY_TYPE_UNKNOWN; ret = (BatteryMonitor::PowerSupplyType)mapSysfsString(buf, supplyTypeMap); - if (ret < 0) + if (ret < 0) { + KLOG_WARNING(LOG_TAG, "Unknown power supply type '%s'\n", buf); ret = ANDROID_POWER_SUPPLY_TYPE_UNKNOWN; + } return ret; } |