Loading healthd/BatteryMonitor.cpp +18 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #define POWER_SUPPLY_SYSFS_PATH "/sys/class/" POWER_SUPPLY_SUBSYSTEM #define FAKE_BATTERY_CAPACITY 42 #define FAKE_BATTERY_TEMPERATURE 424 #define ALWAYS_PLUGGED_CAPACITY 100 namespace android { Loading Loading @@ -199,6 +200,15 @@ bool BatteryMonitor::update(void) { mBatteryFixedTemperature : getIntField(mHealthdConfig->batteryTemperaturePath); // For devices which do not have battery and are always plugged // into power souce. if (mAlwaysPluggedDevice) { props.chargerAcOnline = true; props.batteryPresent = true; props.batteryStatus = BATTERY_STATUS_CHARGING; props.batteryHealth = BATTERY_HEALTH_GOOD; } const int SIZE = 128; char buf[SIZE]; String8 btech; Loading Loading @@ -542,8 +552,15 @@ void BatteryMonitor::init(struct healthd_config *hc) { closedir(dir); } if (!mChargerNames.size()) // 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; Loading healthd/BatteryMonitor.h +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ class BatteryMonitor { struct healthd_config *mHealthdConfig; Vector<String8> mChargerNames; bool mBatteryDevicePresent; bool mAlwaysPluggedDevice; int mBatteryFixedCapacity; int mBatteryFixedTemperature; struct BatteryProperties props; Loading Loading
healthd/BatteryMonitor.cpp +18 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #define POWER_SUPPLY_SYSFS_PATH "/sys/class/" POWER_SUPPLY_SUBSYSTEM #define FAKE_BATTERY_CAPACITY 42 #define FAKE_BATTERY_TEMPERATURE 424 #define ALWAYS_PLUGGED_CAPACITY 100 namespace android { Loading Loading @@ -199,6 +200,15 @@ bool BatteryMonitor::update(void) { mBatteryFixedTemperature : getIntField(mHealthdConfig->batteryTemperaturePath); // For devices which do not have battery and are always plugged // into power souce. if (mAlwaysPluggedDevice) { props.chargerAcOnline = true; props.batteryPresent = true; props.batteryStatus = BATTERY_STATUS_CHARGING; props.batteryHealth = BATTERY_HEALTH_GOOD; } const int SIZE = 128; char buf[SIZE]; String8 btech; Loading Loading @@ -542,8 +552,15 @@ void BatteryMonitor::init(struct healthd_config *hc) { closedir(dir); } if (!mChargerNames.size()) // 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; Loading
healthd/BatteryMonitor.h +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ class BatteryMonitor { struct healthd_config *mHealthdConfig; Vector<String8> mChargerNames; bool mBatteryDevicePresent; bool mAlwaysPluggedDevice; int mBatteryFixedCapacity; int mBatteryFixedTemperature; struct BatteryProperties props; Loading