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

Commit 89e2d4dc authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by android-build-merger
Browse files

Merge "healthd: Check if battery device exists instead of charger drivers...

Merge "healthd: Check if battery device exists instead of charger drivers before setting fake properties."
am: ed608b30

* commit 'ed608b30':
  healthd: Check if battery device exists instead of charger drivers before setting fake properties.
parents 3e8bed5f ed608b30
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -630,19 +630,15 @@ void BatteryMonitor::init(struct healthd_config *hc) {
        }
    }

    // This indicates that there is no charger driver registered.
    // Typically the case for devices which do not have a battery and
    // and are always plugged into AC mains.
    if (!mChargerNames.size()) {
        KLOG_ERROR(LOG_TAG, "No charger supplies found\n");
        mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;
        mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE;
        mAlwaysPluggedDevice = true;
    }
    if (!mBatteryDevicePresent) {
        KLOG_WARNING(LOG_TAG, "No battery devices found\n");
        hc->periodic_chores_interval_fast = -1;
        hc->periodic_chores_interval_slow = -1;
        mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;
        mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE;
        mAlwaysPluggedDevice = true;
    } else {
        if (mHealthdConfig->batteryStatusPath.isEmpty())
            KLOG_WARNING(LOG_TAG, "BatteryStatusPath not found\n");