Loading healthd/BatteryMonitor.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <algorithm> #include <memory> #include <android-base/file.h> Loading Loading @@ -476,10 +478,16 @@ void BatteryMonitor::init(struct healthd_config *hc) { while ((entry = readdir(dir.get()))) { const char* name = entry->d_name; std::vector<String8>::iterator itIgnoreName; if (!strcmp(name, ".") || !strcmp(name, "..")) continue; itIgnoreName = find(hc->ignorePowerSupplyNames.begin(), hc->ignorePowerSupplyNames.end(), String8(name)); if (itIgnoreName != hc->ignorePowerSupplyNames.end()) continue; // Look for "type" file in each subdirectory path.clear(); path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name); Loading healthd/include/healthd/healthd.h +3 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ #include <utils/Errors.h> #include <utils/String8.h> #include <vector> // periodic_chores_interval_fast, periodic_chores_interval_slow: intervals at // which healthd wakes up to poll health state and perform periodic chores, // in units of seconds: Loading Loading @@ -71,6 +73,7 @@ struct healthd_config { int (*energyCounter)(int64_t *); int boot_min_cap; bool (*screen_on)(android::BatteryProperties *props); std::vector<android::String8> ignorePowerSupplyNames; }; enum EventWakeup { Loading Loading
healthd/BatteryMonitor.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <algorithm> #include <memory> #include <android-base/file.h> Loading Loading @@ -476,10 +478,16 @@ void BatteryMonitor::init(struct healthd_config *hc) { while ((entry = readdir(dir.get()))) { const char* name = entry->d_name; std::vector<String8>::iterator itIgnoreName; if (!strcmp(name, ".") || !strcmp(name, "..")) continue; itIgnoreName = find(hc->ignorePowerSupplyNames.begin(), hc->ignorePowerSupplyNames.end(), String8(name)); if (itIgnoreName != hc->ignorePowerSupplyNames.end()) continue; // Look for "type" file in each subdirectory path.clear(); path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name); Loading
healthd/include/healthd/healthd.h +3 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ #include <utils/Errors.h> #include <utils/String8.h> #include <vector> // periodic_chores_interval_fast, periodic_chores_interval_slow: intervals at // which healthd wakes up to poll health state and perform periodic chores, // in units of seconds: Loading Loading @@ -71,6 +73,7 @@ struct healthd_config { int (*energyCounter)(int64_t *); int boot_min_cap; bool (*screen_on)(android::BatteryProperties *props); std::vector<android::String8> ignorePowerSupplyNames; }; enum EventWakeup { Loading