diff options
author | Ruchi Kandoi <kandoiruchi@google.com> | 2016-02-29 13:13:39 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-07-10 10:30:22 -0700 |
commit | 5b537bbac12ada45240f441d830bb94c42696230 (patch) | |
tree | 9ee7b6fb048502ce00af6236e36998c390ace814 | |
parent | 5d90c85e977df6dd34443b6050db5c994570f410 (diff) | |
download | system_core-5b537bbac12ada45240f441d830bb94c42696230.zip system_core-5b537bbac12ada45240f441d830bb94c42696230.tar.gz system_core-5b537bbac12ada45240f441d830bb94c42696230.tar.bz2 |
healthd: Check if battery device exists instead of charger drivers before
setting fake properties.
healthd used to check for registered charger drivers to determine if the
device is an always-plugged device with no battery. This patch changes
it to check for battery instead.
Change-Id: Ie4ff5d3f21dc1a83a780a41eb0c929f66b86d631
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
-rw-r--r-- | healthd/BatteryMonitor.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index dfa59b8..a59c779 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -835,19 +835,15 @@ void BatteryMonitor::init(struct healthd_config *hc) { closedir(dir); } - // 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 && !mDockBatteryDevicePresent) { 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"); |