summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-01-30 14:24:12 -0800
committerTodd Poynor <toddpoynor@google.com>2013-01-30 14:24:12 -0800
commit78d8fe4bd64e489095db0ccece9cb8288970df9a (patch)
treea3a35d30b68d4e863f51611726d2391a53612fd3 /services/jni
parent701bfb10349cebc8075394f0920462cb9e6d79e3 (diff)
downloadframeworks_base-78d8fe4bd64e489095db0ccece9cb8288970df9a.zip
frameworks_base-78d8fe4bd64e489095db0ccece9cb8288970df9a.tar.gz
frameworks_base-78d8fe4bd64e489095db0ccece9cb8288970df9a.tar.bz2
BatteryService: Treat USB charging ports and charging accessories as AC
Change-Id: If98330b09a1fc44992bb96195804d434a4e20470
Diffstat (limited to 'services/jni')
-rw-r--r--services/jni/com_android_server_BatteryService.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/jni/com_android_server_BatteryService.cpp b/services/jni/com_android_server_BatteryService.cpp
index d3f3591..485c289 100644
--- a/services/jni/com_android_server_BatteryService.cpp
+++ b/services/jni/com_android_server_BatteryService.cpp
@@ -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;