fixup! healthd: Reinitialize mChargerNames for every battery update
Copy paste dock support from BatteryMonitor::init(). Change-Id: Iba587c318b92001ab7812f6b4d3433b5f17785f4
This commit is contained in:
parent
9cb248617d
commit
f2d8913afe
1 changed files with 12 additions and 0 deletions
|
@ -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));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue