Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bef6c86 authored by Yifan Hong's avatar Yifan Hong Committed by android-build-merger
Browse files

Merge changes from topic "batt_mon_2_1_types" am: a1015599 am: 38ea0a06

am: d8a7c8a6

Change-Id: I6c4ef7ee2449df4a18b27ca14366dc6f3b97a081
parents 88ddf9e4 d8a7c8a6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ using HealthInfo_2_0 = android::hardware::health::V2_0::HealthInfo;
using HealthInfo_2_1 = android::hardware::health::V2_1::HealthInfo;
using android::hardware::health::V1_0::BatteryHealth;
using android::hardware::health::V1_0::BatteryStatus;
using android::hardware::health::V2_1::BatteryCapacityLevel;

namespace android {

@@ -223,6 +224,15 @@ void BatteryMonitor::updateValues(void) {
    if (!mHealthdConfig->batteryChargeCounterPath.isEmpty())
        props.batteryChargeCounter = getIntField(mHealthdConfig->batteryChargeCounterPath);

    if (!mHealthdConfig->batteryCurrentAvgPath.isEmpty())
        mHealthInfo->legacy.batteryCurrentAverage =
                getIntField(mHealthdConfig->batteryCurrentAvgPath);

    // TODO(b/142260281): Retrieve these values correctly.
    mHealthInfo->batteryCapacityLevel = BatteryCapacityLevel::UNKNOWN;
    mHealthInfo->batteryChargeTimeToFullNowSeconds = 0;
    mHealthInfo->batteryFullCapacityUah = props.batteryFullCharge;

    props.batteryTemperature = mBatteryFixedTemperature ?
        mBatteryFixedTemperature :
        getIntField(mHealthdConfig->batteryTemperaturePath);