fixup! healthd: Reinitialize mChargerNames for every battery update

Change-Id: I725578f0c445de8e177a1b02bd81a548ccde1493
This commit is contained in:
Michael Bestas 2024-03-10 18:47:36 +02:00 committed by zlewchan
parent 95f29b7678
commit e5ae3b7888

View file

@ -471,7 +471,7 @@ void BatteryMonitor::updateValues(void) {
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)
if (access(path.c_str(), R_OK) == 0)
mChargerNames.add(String8(name));
break;
default:
@ -481,10 +481,10 @@ void BatteryMonitor::updateValues(void) {
// 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) {
if (access(path.c_str(), R_OK) == 0) {
path.clear();
path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name);
if (access(path.string(), R_OK) == 0)
if (access(path.c_str(), R_OK) == 0)
mChargerNames.add(String8(name));
}