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

Commit 979ace46 authored by Yi Kong's avatar Yi Kong Committed by android-build-merger
Browse files

Merge "healthd: Fix negativity check after cast to unsigned enum" am: 3dad67af am: 47349812

am: eb066ae0

Change-Id: I2327adfd50fceb232ef2a52e535914743c25cf3a
parents 6027705f eb066ae0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ int BatteryMonitor::readFromFile(const String8& path, std::string* buf) {

BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) {
    std::string buf;
    BatteryMonitor::PowerSupplyType ret;
    int ret;
    struct sysfsStringEnumMap supplyTypeMap[] = {
            { "Unknown", ANDROID_POWER_SUPPLY_TYPE_UNKNOWN },
            { "Battery", ANDROID_POWER_SUPPLY_TYPE_BATTERY },
@@ -168,13 +168,13 @@ BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String
    if (readFromFile(path, &buf) <= 0)
        return ANDROID_POWER_SUPPLY_TYPE_UNKNOWN;

    ret = (BatteryMonitor::PowerSupplyType)mapSysfsString(buf.c_str(), supplyTypeMap);
    ret = mapSysfsString(buf.c_str(), supplyTypeMap);
    if (ret < 0) {
        KLOG_WARNING(LOG_TAG, "Unknown power supply type '%s'\n", buf.c_str());
        ret = ANDROID_POWER_SUPPLY_TYPE_UNKNOWN;
    }

    return ret;
    return static_cast<BatteryMonitor::PowerSupplyType>(ret);
}

bool BatteryMonitor::getBooleanField(const String8& path) {