diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index eb04a90b3..c8fca6224 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -468,6 +468,7 @@ void BatteryMonitor::updateValues(void) { case ANDROID_POWER_SUPPLY_TYPE_AC: case ANDROID_POWER_SUPPLY_TYPE_USB: case ANDROID_POWER_SUPPLY_TYPE_WIRELESS: + case ANDROID_POWER_SUPPLY_TYPE_DOCK: path.clear(); path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name); if (access(path.string(), R_OK) == 0) @@ -476,6 +477,17 @@ void BatteryMonitor::updateValues(void) { default: break; } + + // Look for "is_dock" file + path.clear(); + path.appendFormat("%s/%s/is_dock", POWER_SUPPLY_SYSFS_PATH, name); + if (access(path.string(), R_OK) == 0) { + path.clear(); + path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name); + if (access(path.string(), R_OK) == 0) + mChargerNames.add(String8(name)); + + } } }