healthd: Check if battery device exists instead of charger drivers before setting fake properties. am: 9cb3d3ccf4 am: f2ca669e80

am: 6e394f0f6c

* commit '6e394f0f6c693e6f05def66d0427abd385b3f798':
  healthd: Check if battery device exists instead of charger drivers before setting fake properties.

Change-Id: Iea48fb20a7f07c7b9cb212cafd00147f07021ae2
This commit is contained in:
Ruchi Kandoi 2016-05-17 18:42:29 +00:00 committed by android-build-merger
commit 8b38bcc915

View file

@ -635,19 +635,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");