summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2016-02-29 13:13:39 -0800
committerAlain Vongsouvanh <alainv@google.com>2016-05-16 08:58:35 -0700
commit9cb3d3ccf49bf0fd484563fbf611c68789d5b8a9 (patch)
tree6941ba0352c365301f22f13d4d99e881b778c013 /healthd
parenta463d246339f405981bd690209429ef5acf0f01d (diff)
downloadsystem_core-9cb3d3ccf49bf0fd484563fbf611c68789d5b8a9.tar.gz
system_core-9cb3d3ccf49bf0fd484563fbf611c68789d5b8a9.tar.bz2
system_core-9cb3d3ccf49bf0fd484563fbf611c68789d5b8a9.zip
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> (cherry picked from commit fabd490f58df73711a56478c9777f397fca733f6)
Diffstat (limited to 'healthd')
-rw-r--r--healthd/BatteryMonitor.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 396dfef5a..577ff2bc5 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -552,19 +552,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) {
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");