blob: b7215537a3565ef3b582119f1b581e050f0db10e [file] [log] [blame]
Todd Poynor752faf22013-06-12 13:25:59 -07001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "healthd"
18
Todd Poynor10b235e2013-08-07 15:25:14 -070019#include "healthd.h"
Todd Poynor752faf22013-06-12 13:25:59 -070020#include "BatteryMonitor.h"
Todd Poynor752faf22013-06-12 13:25:59 -070021
22#include <dirent.h>
23#include <errno.h>
24#include <fcntl.h>
25#include <stdio.h>
26#include <stdlib.h>
27#include <unistd.h>
28#include <batteryservice/BatteryService.h>
29#include <cutils/klog.h>
Todd Poynorc133b712013-08-14 17:39:13 -070030#include <utils/Errors.h>
Todd Poynor752faf22013-06-12 13:25:59 -070031#include <utils/String8.h>
32#include <utils/Vector.h>
33
34#define POWER_SUPPLY_SUBSYSTEM "power_supply"
35#define POWER_SUPPLY_SYSFS_PATH "/sys/class/" POWER_SUPPLY_SUBSYSTEM
36
37namespace android {
38
39struct sysfsStringEnumMap {
40 char* s;
41 int val;
42};
43
44static int mapSysfsString(const char* str,
45 struct sysfsStringEnumMap map[]) {
46 for (int i = 0; map[i].s; i++)
47 if (!strcmp(str, map[i].s))
48 return map[i].val;
49
50 return -1;
51}
52
53int BatteryMonitor::getBatteryStatus(const char* status) {
54 int ret;
55 struct sysfsStringEnumMap batteryStatusMap[] = {
56 { "Unknown", BATTERY_STATUS_UNKNOWN },
57 { "Charging", BATTERY_STATUS_CHARGING },
58 { "Discharging", BATTERY_STATUS_DISCHARGING },
59 { "Not charging", BATTERY_STATUS_NOT_CHARGING },
60 { "Full", BATTERY_STATUS_FULL },
61 { NULL, 0 },
62 };
63
64 ret = mapSysfsString(status, batteryStatusMap);
65 if (ret < 0) {
66 KLOG_WARNING(LOG_TAG, "Unknown battery status '%s'\n", status);
67 ret = BATTERY_STATUS_UNKNOWN;
68 }
69
70 return ret;
71}
72
73int BatteryMonitor::getBatteryHealth(const char* status) {
74 int ret;
75 struct sysfsStringEnumMap batteryHealthMap[] = {
76 { "Unknown", BATTERY_HEALTH_UNKNOWN },
77 { "Good", BATTERY_HEALTH_GOOD },
78 { "Overheat", BATTERY_HEALTH_OVERHEAT },
79 { "Dead", BATTERY_HEALTH_DEAD },
80 { "Over voltage", BATTERY_HEALTH_OVER_VOLTAGE },
81 { "Unspecified failure", BATTERY_HEALTH_UNSPECIFIED_FAILURE },
82 { "Cold", BATTERY_HEALTH_COLD },
83 { NULL, 0 },
84 };
85
86 ret = mapSysfsString(status, batteryHealthMap);
87 if (ret < 0) {
88 KLOG_WARNING(LOG_TAG, "Unknown battery health '%s'\n", status);
89 ret = BATTERY_HEALTH_UNKNOWN;
90 }
91
92 return ret;
93}
94
95int BatteryMonitor::readFromFile(const String8& path, char* buf, size_t size) {
96 char *cp = NULL;
97
98 if (path.isEmpty())
99 return -1;
100 int fd = open(path.string(), O_RDONLY, 0);
101 if (fd == -1) {
102 KLOG_ERROR(LOG_TAG, "Could not open '%s'\n", path.string());
103 return -1;
104 }
105
106 ssize_t count = TEMP_FAILURE_RETRY(read(fd, buf, size));
107 if (count > 0)
108 cp = (char *)memrchr(buf, '\n', count);
109
110 if (cp)
111 *cp = '\0';
112 else
113 buf[0] = '\0';
114
115 close(fd);
116 return count;
117}
118
119BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) {
120 const int SIZE = 128;
121 char buf[SIZE];
122 int length = readFromFile(path, buf, SIZE);
123 BatteryMonitor::PowerSupplyType ret;
124 struct sysfsStringEnumMap supplyTypeMap[] = {
125 { "Unknown", ANDROID_POWER_SUPPLY_TYPE_UNKNOWN },
126 { "Battery", ANDROID_POWER_SUPPLY_TYPE_BATTERY },
127 { "UPS", ANDROID_POWER_SUPPLY_TYPE_AC },
128 { "Mains", ANDROID_POWER_SUPPLY_TYPE_AC },
129 { "USB", ANDROID_POWER_SUPPLY_TYPE_USB },
130 { "USB_DCP", ANDROID_POWER_SUPPLY_TYPE_AC },
131 { "USB_CDP", ANDROID_POWER_SUPPLY_TYPE_AC },
132 { "USB_ACA", ANDROID_POWER_SUPPLY_TYPE_AC },
133 { "Wireless", ANDROID_POWER_SUPPLY_TYPE_WIRELESS },
134 { NULL, 0 },
135 };
136
137 if (length <= 0)
138 return ANDROID_POWER_SUPPLY_TYPE_UNKNOWN;
139
140 ret = (BatteryMonitor::PowerSupplyType)mapSysfsString(buf, supplyTypeMap);
141 if (ret < 0)
142 ret = ANDROID_POWER_SUPPLY_TYPE_UNKNOWN;
143
144 return ret;
145}
146
147bool BatteryMonitor::getBooleanField(const String8& path) {
148 const int SIZE = 16;
149 char buf[SIZE];
150
151 bool value = false;
152 if (readFromFile(path, buf, SIZE) > 0) {
153 if (buf[0] != '0') {
154 value = true;
155 }
156 }
157
158 return value;
159}
160
161int BatteryMonitor::getIntField(const String8& path) {
162 const int SIZE = 128;
163 char buf[SIZE];
164
165 int value = 0;
166 if (readFromFile(path, buf, SIZE) > 0) {
167 value = strtol(buf, NULL, 0);
168 }
169 return value;
170}
171
172bool BatteryMonitor::update(void) {
Todd Poynor2e227fb2013-09-30 15:36:44 -0700173 struct BatteryExtraProperties extraProps;
Todd Poynor10b235e2013-08-07 15:25:14 -0700174 bool logthis;
Todd Poynor752faf22013-06-12 13:25:59 -0700175
176 props.chargerAcOnline = false;
177 props.chargerUsbOnline = false;
178 props.chargerWirelessOnline = false;
179 props.batteryStatus = BATTERY_STATUS_UNKNOWN;
180 props.batteryHealth = BATTERY_HEALTH_UNKNOWN;
Todd Poynor2e227fb2013-09-30 15:36:44 -0700181 extraProps.batteryCurrentNow = INT_MIN;
182 extraProps.batteryChargeCounter = INT_MIN;
Todd Poynor752faf22013-06-12 13:25:59 -0700183
Todd Poynorf5d30122013-08-12 17:03:35 -0700184 if (!mHealthdConfig->batteryPresentPath.isEmpty())
185 props.batteryPresent = getBooleanField(mHealthdConfig->batteryPresentPath);
Todd Poynor752faf22013-06-12 13:25:59 -0700186 else
Todd Poynor6dcc45e2013-10-21 20:26:25 -0700187 props.batteryPresent = mBatteryDevicePresent;
Todd Poynor752faf22013-06-12 13:25:59 -0700188
Todd Poynorf5d30122013-08-12 17:03:35 -0700189 props.batteryLevel = getIntField(mHealthdConfig->batteryCapacityPath);
190 props.batteryVoltage = getIntField(mHealthdConfig->batteryVoltagePath) / 1000;
Todd Poynorb45f1f52013-07-30 18:57:16 -0700191
Todd Poynorf5d30122013-08-12 17:03:35 -0700192 if (!mHealthdConfig->batteryCurrentNowPath.isEmpty())
Todd Poynor2e227fb2013-09-30 15:36:44 -0700193 extraProps.batteryCurrentNow = getIntField(mHealthdConfig->batteryCurrentNowPath);
Todd Poynorb45f1f52013-07-30 18:57:16 -0700194
Todd Poynor2e227fb2013-09-30 15:36:44 -0700195 /* temporary while dumpsys being reworked */
Todd Poynorf5d30122013-08-12 17:03:35 -0700196 if (!mHealthdConfig->batteryChargeCounterPath.isEmpty())
Todd Poynor2e227fb2013-09-30 15:36:44 -0700197 extraProps.batteryChargeCounter = getIntField(mHealthdConfig->batteryChargeCounterPath);
Todd Poynorb45f1f52013-07-30 18:57:16 -0700198
Todd Poynorf5d30122013-08-12 17:03:35 -0700199 props.batteryTemperature = getIntField(mHealthdConfig->batteryTemperaturePath);
Todd Poynor752faf22013-06-12 13:25:59 -0700200
201 const int SIZE = 128;
202 char buf[SIZE];
203 String8 btech;
204
Todd Poynorf5d30122013-08-12 17:03:35 -0700205 if (readFromFile(mHealthdConfig->batteryStatusPath, buf, SIZE) > 0)
Todd Poynor752faf22013-06-12 13:25:59 -0700206 props.batteryStatus = getBatteryStatus(buf);
207
Todd Poynorf5d30122013-08-12 17:03:35 -0700208 if (readFromFile(mHealthdConfig->batteryHealthPath, buf, SIZE) > 0)
Todd Poynor752faf22013-06-12 13:25:59 -0700209 props.batteryHealth = getBatteryHealth(buf);
210
Todd Poynorf5d30122013-08-12 17:03:35 -0700211 if (readFromFile(mHealthdConfig->batteryTechnologyPath, buf, SIZE) > 0)
Todd Poynor752faf22013-06-12 13:25:59 -0700212 props.batteryTechnology = String8(buf);
213
214 unsigned int i;
215
216 for (i = 0; i < mChargerNames.size(); i++) {
217 String8 path;
218 path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH,
219 mChargerNames[i].string());
220
221 if (readFromFile(path, buf, SIZE) > 0) {
222 if (buf[0] != '0') {
223 path.clear();
224 path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH,
225 mChargerNames[i].string());
226 switch(readPowerSupplyType(path)) {
227 case ANDROID_POWER_SUPPLY_TYPE_AC:
228 props.chargerAcOnline = true;
229 break;
230 case ANDROID_POWER_SUPPLY_TYPE_USB:
231 props.chargerUsbOnline = true;
232 break;
233 case ANDROID_POWER_SUPPLY_TYPE_WIRELESS:
234 props.chargerWirelessOnline = true;
235 break;
236 default:
237 KLOG_WARNING(LOG_TAG, "%s: Unknown power supply type\n",
238 mChargerNames[i].string());
239 }
240 }
241 }
242 }
243
Todd Poynor10b235e2013-08-07 15:25:14 -0700244 logthis = !healthd_board_battery_update(&props);
Todd Poynorb45f1f52013-07-30 18:57:16 -0700245
Todd Poynor10b235e2013-08-07 15:25:14 -0700246 if (logthis) {
247 char dmesgline[256];
Todd Poynor6dcc45e2013-10-21 20:26:25 -0700248
249 if (props.batteryPresent)
250 snprintf(dmesgline, sizeof(dmesgline),
Todd Poynor10b235e2013-08-07 15:25:14 -0700251 "battery l=%d v=%d t=%s%d.%d h=%d st=%d",
252 props.batteryLevel, props.batteryVoltage,
253 props.batteryTemperature < 0 ? "-" : "",
254 abs(props.batteryTemperature / 10),
255 abs(props.batteryTemperature % 10), props.batteryHealth,
256 props.batteryStatus);
Todd Poynor6dcc45e2013-10-21 20:26:25 -0700257 else
258 snprintf(dmesgline, sizeof(dmesgline),
259 "battery none");
Todd Poynorb45f1f52013-07-30 18:57:16 -0700260
Todd Poynorf5d30122013-08-12 17:03:35 -0700261 if (!mHealthdConfig->batteryCurrentNowPath.isEmpty()) {
Todd Poynor10b235e2013-08-07 15:25:14 -0700262 char b[20];
263
Todd Poynor2e227fb2013-09-30 15:36:44 -0700264 snprintf(b, sizeof(b), " c=%d", extraProps.batteryCurrentNow / 1000);
Todd Poynor10b235e2013-08-07 15:25:14 -0700265 strlcat(dmesgline, b, sizeof(dmesgline));
266 }
267
268 KLOG_INFO(LOG_TAG, "%s chg=%s%s%s\n", dmesgline,
269 props.chargerAcOnline ? "a" : "",
270 props.chargerUsbOnline ? "u" : "",
271 props.chargerWirelessOnline ? "w" : "");
Todd Poynorb45f1f52013-07-30 18:57:16 -0700272 }
273
Todd Poynorc7464c92013-09-10 12:40:00 -0700274 healthd_mode_ops->battery_update(&props);
Todd Poynor752faf22013-06-12 13:25:59 -0700275 return props.chargerAcOnline | props.chargerUsbOnline |
276 props.chargerWirelessOnline;
277}
278
Todd Poynorc133b712013-08-14 17:39:13 -0700279status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) {
280 status_t ret = BAD_VALUE;
281
282 switch(id) {
283 case BATTERY_PROP_CHARGE_COUNTER:
284 if (!mHealthdConfig->batteryChargeCounterPath.isEmpty()) {
285 val->valueInt =
286 getIntField(mHealthdConfig->batteryChargeCounterPath);
287 ret = NO_ERROR;
288 } else {
289 ret = NAME_NOT_FOUND;
290 }
291 break;
292
293 case BATTERY_PROP_CURRENT_NOW:
294 if (!mHealthdConfig->batteryCurrentNowPath.isEmpty()) {
295 val->valueInt =
296 getIntField(mHealthdConfig->batteryCurrentNowPath);
297 ret = NO_ERROR;
298 } else {
299 ret = NAME_NOT_FOUND;
300 }
301 break;
302
Todd Poynorbc102112013-08-27 18:11:49 -0700303 case BATTERY_PROP_CURRENT_AVG:
304 if (!mHealthdConfig->batteryCurrentAvgPath.isEmpty()) {
305 val->valueInt =
306 getIntField(mHealthdConfig->batteryCurrentAvgPath);
307 ret = NO_ERROR;
308 } else {
309 ret = NAME_NOT_FOUND;
310 }
311 break;
312
Todd Poynorc133b712013-08-14 17:39:13 -0700313 default:
314 break;
315 }
316
317 if (ret != NO_ERROR)
318 val->valueInt = INT_MIN;
319
320 return ret;
321}
322
Todd Poynor020369d2013-09-18 20:09:33 -0700323void BatteryMonitor::dumpState(int fd) {
324 int v;
325 char vs[128];
326
327 snprintf(vs, sizeof(vs), "ac: %d usb: %d wireless: %d\n",
328 props.chargerAcOnline, props.chargerUsbOnline,
329 props.chargerWirelessOnline);
330 write(fd, vs, strlen(vs));
331 snprintf(vs, sizeof(vs), "status: %d health: %d present: %d\n",
332 props.batteryStatus, props.batteryHealth, props.batteryPresent);
333 write(fd, vs, strlen(vs));
334 snprintf(vs, sizeof(vs), "level: %d voltage: %d temp: %d\n",
335 props.batteryLevel, props.batteryVoltage,
336 props.batteryTemperature);
337 write(fd, vs, strlen(vs));
338
339 if (!mHealthdConfig->batteryCurrentNowPath.isEmpty()) {
340 v = getIntField(mHealthdConfig->batteryCurrentNowPath);
341 snprintf(vs, sizeof(vs), "current now: %d\n", v);
342 write(fd, vs, strlen(vs));
343 }
344
345 if (!mHealthdConfig->batteryCurrentAvgPath.isEmpty()) {
346 v = getIntField(mHealthdConfig->batteryCurrentAvgPath);
347 snprintf(vs, sizeof(vs), "current avg: %d\n", v);
348 write(fd, vs, strlen(vs));
349 }
350
351 if (!mHealthdConfig->batteryChargeCounterPath.isEmpty()) {
352 v = getIntField(mHealthdConfig->batteryChargeCounterPath);
353 snprintf(vs, sizeof(vs), "charge counter: %d\n", v);
354 write(fd, vs, strlen(vs));
355 }
356}
357
Todd Poynorc7464c92013-09-10 12:40:00 -0700358void BatteryMonitor::init(struct healthd_config *hc) {
Todd Poynor752faf22013-06-12 13:25:59 -0700359 String8 path;
360
Todd Poynorf5d30122013-08-12 17:03:35 -0700361 mHealthdConfig = hc;
Todd Poynor752faf22013-06-12 13:25:59 -0700362 DIR* dir = opendir(POWER_SUPPLY_SYSFS_PATH);
363 if (dir == NULL) {
364 KLOG_ERROR(LOG_TAG, "Could not open %s\n", POWER_SUPPLY_SYSFS_PATH);
365 } else {
366 struct dirent* entry;
367
368 while ((entry = readdir(dir))) {
369 const char* name = entry->d_name;
370
371 if (!strcmp(name, ".") || !strcmp(name, ".."))
372 continue;
373
374 char buf[20];
375 // Look for "type" file in each subdirectory
376 path.clear();
377 path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name);
378 switch(readPowerSupplyType(path)) {
379 case ANDROID_POWER_SUPPLY_TYPE_AC:
380 case ANDROID_POWER_SUPPLY_TYPE_USB:
381 case ANDROID_POWER_SUPPLY_TYPE_WIRELESS:
382 path.clear();
383 path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name);
384 if (access(path.string(), R_OK) == 0)
385 mChargerNames.add(String8(name));
386 break;
387
388 case ANDROID_POWER_SUPPLY_TYPE_BATTERY:
Todd Poynor6dcc45e2013-10-21 20:26:25 -0700389 mBatteryDevicePresent = true;
390
Todd Poynorf5d30122013-08-12 17:03:35 -0700391 if (mHealthdConfig->batteryStatusPath.isEmpty()) {
Todd Poynor752faf22013-06-12 13:25:59 -0700392 path.clear();
Todd Poynorf5d30122013-08-12 17:03:35 -0700393 path.appendFormat("%s/%s/status", POWER_SUPPLY_SYSFS_PATH,
394 name);
Todd Poynor752faf22013-06-12 13:25:59 -0700395 if (access(path, R_OK) == 0)
Todd Poynorf5d30122013-08-12 17:03:35 -0700396 mHealthdConfig->batteryStatusPath = path;
Todd Poynor752faf22013-06-12 13:25:59 -0700397 }
398
Todd Poynorf5d30122013-08-12 17:03:35 -0700399 if (mHealthdConfig->batteryHealthPath.isEmpty()) {
Todd Poynor752faf22013-06-12 13:25:59 -0700400 path.clear();
Todd Poynorf5d30122013-08-12 17:03:35 -0700401 path.appendFormat("%s/%s/health", POWER_SUPPLY_SYSFS_PATH,
402 name);
Todd Poynor752faf22013-06-12 13:25:59 -0700403 if (access(path, R_OK) == 0)
Todd Poynorf5d30122013-08-12 17:03:35 -0700404 mHealthdConfig->batteryHealthPath = path;
Todd Poynor752faf22013-06-12 13:25:59 -0700405 }
406
Todd Poynorf5d30122013-08-12 17:03:35 -0700407 if (mHealthdConfig->batteryPresentPath.isEmpty()) {
408 path.clear();
409 path.appendFormat("%s/%s/present", POWER_SUPPLY_SYSFS_PATH,
410 name);
411 if (access(path, R_OK) == 0)
412 mHealthdConfig->batteryPresentPath = path;
413 }
414
415 if (mHealthdConfig->batteryCapacityPath.isEmpty()) {
416 path.clear();
417 path.appendFormat("%s/%s/capacity", POWER_SUPPLY_SYSFS_PATH,
418 name);
419 if (access(path, R_OK) == 0)
420 mHealthdConfig->batteryCapacityPath = path;
421 }
422
423 if (mHealthdConfig->batteryVoltagePath.isEmpty()) {
424 path.clear();
425 path.appendFormat("%s/%s/voltage_now",
426 POWER_SUPPLY_SYSFS_PATH, name);
427 if (access(path, R_OK) == 0) {
428 mHealthdConfig->batteryVoltagePath = path;
429 } else {
430 path.clear();
431 path.appendFormat("%s/%s/batt_vol",
432 POWER_SUPPLY_SYSFS_PATH, name);
433 if (access(path, R_OK) == 0)
434 mHealthdConfig->batteryVoltagePath = path;
435 }
436 }
437
438 if (mHealthdConfig->batteryCurrentNowPath.isEmpty()) {
439 path.clear();
440 path.appendFormat("%s/%s/current_now",
441 POWER_SUPPLY_SYSFS_PATH, name);
442 if (access(path, R_OK) == 0)
443 mHealthdConfig->batteryCurrentNowPath = path;
444 }
445
Todd Poynorbc102112013-08-27 18:11:49 -0700446 if (mHealthdConfig->batteryCurrentAvgPath.isEmpty()) {
447 path.clear();
448 path.appendFormat("%s/%s/current_avg",
449 POWER_SUPPLY_SYSFS_PATH, name);
450 if (access(path, R_OK) == 0)
451 mHealthdConfig->batteryCurrentAvgPath = path;
452 }
453
Todd Poynorf5d30122013-08-12 17:03:35 -0700454 if (mHealthdConfig->batteryChargeCounterPath.isEmpty()) {
455 path.clear();
456 path.appendFormat("%s/%s/charge_counter",
457 POWER_SUPPLY_SYSFS_PATH, name);
458 if (access(path, R_OK) == 0)
459 mHealthdConfig->batteryChargeCounterPath = path;
460 }
461
462 if (mHealthdConfig->batteryTemperaturePath.isEmpty()) {
463 path.clear();
464 path.appendFormat("%s/%s/temp", POWER_SUPPLY_SYSFS_PATH,
465 name);
466 if (access(path, R_OK) == 0) {
467 mHealthdConfig->batteryTemperaturePath = path;
468 } else {
469 path.clear();
470 path.appendFormat("%s/%s/batt_temp",
471 POWER_SUPPLY_SYSFS_PATH, name);
472 if (access(path, R_OK) == 0)
473 mHealthdConfig->batteryTemperaturePath = path;
474 }
475 }
476
477 if (mHealthdConfig->batteryTechnologyPath.isEmpty()) {
478 path.clear();
479 path.appendFormat("%s/%s/technology",
480 POWER_SUPPLY_SYSFS_PATH, name);
481 if (access(path, R_OK) == 0)
482 mHealthdConfig->batteryTechnologyPath = path;
483 }
484
Todd Poynor752faf22013-06-12 13:25:59 -0700485 break;
486
487 case ANDROID_POWER_SUPPLY_TYPE_UNKNOWN:
488 break;
489 }
490 }
491 closedir(dir);
492 }
493
494 if (!mChargerNames.size())
495 KLOG_ERROR(LOG_TAG, "No charger supplies found\n");
Todd Poynor6dcc45e2013-10-21 20:26:25 -0700496 if (!mBatteryDevicePresent) {
497 KLOG_INFO(LOG_TAG, "No battery devices found\n");
498 hc->periodic_chores_interval_fast = -1;
499 hc->periodic_chores_interval_slow = -1;
500 } else {
501 if (mHealthdConfig->batteryStatusPath.isEmpty())
502 KLOG_WARNING(LOG_TAG, "BatteryStatusPath not found\n");
503 if (mHealthdConfig->batteryHealthPath.isEmpty())
504 KLOG_WARNING(LOG_TAG, "BatteryHealthPath not found\n");
505 if (mHealthdConfig->batteryPresentPath.isEmpty())
506 KLOG_WARNING(LOG_TAG, "BatteryPresentPath not found\n");
507 if (mHealthdConfig->batteryCapacityPath.isEmpty())
508 KLOG_WARNING(LOG_TAG, "BatteryCapacityPath not found\n");
509 if (mHealthdConfig->batteryVoltagePath.isEmpty())
510 KLOG_WARNING(LOG_TAG, "BatteryVoltagePath not found\n");
511 if (mHealthdConfig->batteryTemperaturePath.isEmpty())
512 KLOG_WARNING(LOG_TAG, "BatteryTemperaturePath not found\n");
513 if (mHealthdConfig->batteryTechnologyPath.isEmpty())
514 KLOG_WARNING(LOG_TAG, "BatteryTechnologyPath not found\n");
515 }
Todd Poynor752faf22013-06-12 13:25:59 -0700516}
517
518}; // namespace android