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

Commit 4deef119 authored by Stephane Lee's avatar Stephane Lee
Browse files

Assume UNSUPPORTED if the battery capacity level sysfs node does

not exist.

Bug: 163382088
Test: Ensure that, if the ./capacity_level does not exist,
  that the device will shut down at 0 % SOC in an Health 2.1
  implementation
Change-Id: I00822b4bfba5d823c1a30163ea6824e59d3aae32
Merged-In: I00822b4bfba5d823c1a30163ea6824e59d3aae32
parent e689b935
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static void initHealthInfo(HealthInfo_2_1* health_info_2_1) {

    // HIDL enum values are zero initialized, so they need to be initialized
    // properly.
    health_info_2_1->batteryCapacityLevel = BatteryCapacityLevel::UNKNOWN;
    health_info_2_1->batteryCapacityLevel = BatteryCapacityLevel::UNSUPPORTED;
    health_info_2_1->batteryChargeTimeToFullNowSeconds =
            (int64_t)Constants::BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED;
    auto* props = &health_info_2_1->legacy.legacy;