Loading healthd/BatteryMonitor.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -265,7 +265,9 @@ void BatteryMonitor::updateValues(void) { mHealthInfo->batteryChargeTimeToFullNowSeconds = getIntField(mHealthdConfig->batteryChargeTimeToFullNowPath); mHealthInfo->batteryFullCapacityUah = props.batteryFullCharge; if (!mHealthdConfig->batteryFullChargeDesignCapacityUahPath.isEmpty()) mHealthInfo->batteryFullChargeDesignCapacityUah = getIntField(mHealthdConfig->batteryFullChargeDesignCapacityUahPath); props.batteryTemperature = mBatteryFixedTemperature ? mBatteryFixedTemperature : Loading Loading @@ -622,6 +624,13 @@ void BatteryMonitor::init(struct healthd_config *hc) { mHealthdConfig->batteryChargeTimeToFullNowPath = path; } if (mHealthdConfig->batteryFullChargeDesignCapacityUahPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/charge_full_design", POWER_SUPPLY_SYSFS_PATH, name); if (access(path, R_OK) == 0) mHealthdConfig->batteryFullChargeDesignCapacityUahPath = path; } if (mHealthdConfig->batteryCurrentAvgPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/current_avg", Loading Loading @@ -694,6 +703,8 @@ void BatteryMonitor::init(struct healthd_config *hc) { KLOG_WARNING(LOG_TAG, "batteryCapacityLevelPath not found\n"); if (mHealthdConfig->batteryChargeTimeToFullNowPath.isEmpty()) KLOG_WARNING(LOG_TAG, "batteryChargeTimeToFullNowPath. not found\n"); if (mHealthdConfig->batteryFullChargeDesignCapacityUahPath.isEmpty()) KLOG_WARNING(LOG_TAG, "batteryFullChargeDesignCapacityUahPath. not found\n"); } if (property_get("ro.boot.fake_battery", pval, NULL) > 0 Loading healthd/include/healthd/healthd.h +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ struct healthd_config { android::String8 batteryCycleCountPath; android::String8 batteryCapacityLevelPath; android::String8 batteryChargeTimeToFullNowPath; android::String8 batteryFullChargeDesignCapacityUahPath; int (*energyCounter)(int64_t *); int boot_min_cap; Loading Loading
healthd/BatteryMonitor.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -265,7 +265,9 @@ void BatteryMonitor::updateValues(void) { mHealthInfo->batteryChargeTimeToFullNowSeconds = getIntField(mHealthdConfig->batteryChargeTimeToFullNowPath); mHealthInfo->batteryFullCapacityUah = props.batteryFullCharge; if (!mHealthdConfig->batteryFullChargeDesignCapacityUahPath.isEmpty()) mHealthInfo->batteryFullChargeDesignCapacityUah = getIntField(mHealthdConfig->batteryFullChargeDesignCapacityUahPath); props.batteryTemperature = mBatteryFixedTemperature ? mBatteryFixedTemperature : Loading Loading @@ -622,6 +624,13 @@ void BatteryMonitor::init(struct healthd_config *hc) { mHealthdConfig->batteryChargeTimeToFullNowPath = path; } if (mHealthdConfig->batteryFullChargeDesignCapacityUahPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/charge_full_design", POWER_SUPPLY_SYSFS_PATH, name); if (access(path, R_OK) == 0) mHealthdConfig->batteryFullChargeDesignCapacityUahPath = path; } if (mHealthdConfig->batteryCurrentAvgPath.isEmpty()) { path.clear(); path.appendFormat("%s/%s/current_avg", Loading Loading @@ -694,6 +703,8 @@ void BatteryMonitor::init(struct healthd_config *hc) { KLOG_WARNING(LOG_TAG, "batteryCapacityLevelPath not found\n"); if (mHealthdConfig->batteryChargeTimeToFullNowPath.isEmpty()) KLOG_WARNING(LOG_TAG, "batteryChargeTimeToFullNowPath. not found\n"); if (mHealthdConfig->batteryFullChargeDesignCapacityUahPath.isEmpty()) KLOG_WARNING(LOG_TAG, "batteryFullChargeDesignCapacityUahPath. not found\n"); } if (property_get("ro.boot.fake_battery", pval, NULL) > 0 Loading
healthd/include/healthd/healthd.h +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ struct healthd_config { android::String8 batteryCycleCountPath; android::String8 batteryCapacityLevelPath; android::String8 batteryChargeTimeToFullNowPath; android::String8 batteryFullChargeDesignCapacityUahPath; int (*energyCounter)(int64_t *); int boot_min_cap; Loading