Loading healthd/BatteryMonitor.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,16 @@ status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) { } break; case BATTERY_PROP_CURRENT_AVG: if (!mHealthdConfig->batteryCurrentAvgPath.isEmpty()) { val->valueInt = getIntField(mHealthdConfig->batteryCurrentAvgPath); ret = NO_ERROR; } else { ret = NAME_NOT_FOUND; } break; default: break; } Loading Loading @@ -393,6 +403,14 @@ void BatteryMonitor::init(struct healthd_config *hc, bool nosvcmgr) { mHealthdConfig->batteryCurrentNowPath = path; } if (mHealthdConfig->batteryCurrentAvgPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/current_avg", POWER_SUPPLY_SYSFS_PATH, name); if (access(path, R_OK) == 0) mHealthdConfig->batteryCurrentAvgPath = path; } if (mHealthdConfig->batteryChargeCounterPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/charge_counter", Loading healthd/healthd.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ static struct healthd_config healthd_config = { .batteryTemperaturePath = String8(String8::kEmptyString), .batteryTechnologyPath = String8(String8::kEmptyString), .batteryCurrentNowPath = String8(String8::kEmptyString), .batteryCurrentAvgPath = String8(String8::kEmptyString), .batteryChargeCounterPath = String8(String8::kEmptyString), }; Loading healthd/healthd.h +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ struct healthd_config { android::String8 batteryTemperaturePath; android::String8 batteryTechnologyPath; android::String8 batteryCurrentNowPath; android::String8 batteryCurrentAvgPath; android::String8 batteryChargeCounterPath; }; Loading Loading
healthd/BatteryMonitor.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,16 @@ status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) { } break; case BATTERY_PROP_CURRENT_AVG: if (!mHealthdConfig->batteryCurrentAvgPath.isEmpty()) { val->valueInt = getIntField(mHealthdConfig->batteryCurrentAvgPath); ret = NO_ERROR; } else { ret = NAME_NOT_FOUND; } break; default: break; } Loading Loading @@ -393,6 +403,14 @@ void BatteryMonitor::init(struct healthd_config *hc, bool nosvcmgr) { mHealthdConfig->batteryCurrentNowPath = path; } if (mHealthdConfig->batteryCurrentAvgPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/current_avg", POWER_SUPPLY_SYSFS_PATH, name); if (access(path, R_OK) == 0) mHealthdConfig->batteryCurrentAvgPath = path; } if (mHealthdConfig->batteryChargeCounterPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/charge_counter", Loading
healthd/healthd.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ static struct healthd_config healthd_config = { .batteryTemperaturePath = String8(String8::kEmptyString), .batteryTechnologyPath = String8(String8::kEmptyString), .batteryCurrentNowPath = String8(String8::kEmptyString), .batteryCurrentAvgPath = String8(String8::kEmptyString), .batteryChargeCounterPath = String8(String8::kEmptyString), }; Loading
healthd/healthd.h +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ struct healthd_config { android::String8 batteryTemperaturePath; android::String8 batteryTechnologyPath; android::String8 batteryCurrentNowPath; android::String8 batteryCurrentAvgPath; android::String8 batteryChargeCounterPath; }; Loading