BatteryService: Treat USB charging ports and charging accessories as AC

Change-Id: If98330b09a1fc44992bb96195804d434a4e20470
This commit is contained in:
Todd Poynor
2013-01-30 14:24:12 -08:00
parent 701bfb1034
commit 78d8fe4bd6

View File

@@ -215,7 +215,8 @@ static PowerSupplyType readPowerSupplyType(const String8& path) {
buf[length - 1] = 0;
if (strcmp(buf, "Battery") == 0)
return ANDROID_POWER_SUPPLY_TYPE_BATTERY;
else if (strcmp(buf, "Mains") == 0)
else if (strcmp(buf, "Mains") == 0 || strcmp(buf, "USB_DCP") == 0 ||
strcmp(buf, "USB_CDP") == 0 || strcmp(buf, "USB_ACA") == 0)
return ANDROID_POWER_SUPPLY_TYPE_AC;
else if (strcmp(buf, "USB") == 0)
return ANDROID_POWER_SUPPLY_TYPE_USB;