Merge "Consume design capacity in health HAL 2.1"
This commit is contained in:
commit
c7b92ea120
2 changed files with 13 additions and 1 deletions
|
@ -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 :
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue