Lines Matching full:path
99 int BatteryMonitor::readFromFile(const String8& path, char* buf, size_t size) {
102 if (path.isEmpty())
104 int fd = open(path.string(), O_RDONLY, 0);
106 KLOG_ERROR(LOG_TAG, "Could not open '%s'\n", path.string());
123 BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) {
126 int length = readFromFile(path, buf, SIZE);
151 bool BatteryMonitor::getBooleanField(const String8& path) {
156 if (readFromFile(path, buf, SIZE) > 0) {
165 int BatteryMonitor::getIntField(const String8& path) {
170 if (readFromFile(path, buf, SIZE) > 0) {
215 String8 path;
216 path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH,
219 if (readFromFile(path, buf, SIZE) > 0) {
221 path.clear();
222 path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH,
224 switch(readPowerSupplyType(path)) {
376 String8 path;
393 path.clear();
394 path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name);
395 switch(readPowerSupplyType(path)) {
399 path.clear();
400 path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name);
401 if (access(path.string(), R_OK) == 0)
409 path.clear();
410 path.appendFormat("%s/%s/status", POWER_SUPPLY_SYSFS_PATH,
412 if (access(path, R_OK) == 0)
413 mHealthdConfig->batteryStatusPath = path;
417 path.clear();
418 path.appendFormat("%s/%s/health", POWER_SUPPLY_SYSFS_PATH,
420 if (access(path, R_OK) == 0)
421 mHealthdConfig->batteryHealthPath = path;
425 path.clear();
426 path.appendFormat("%s/%s/present", POWER_SUPPLY_SYSFS_PATH,
428 if (access(path, R_OK) == 0)
429 mHealthdConfig->batteryPresentPath = path;
433 path.clear();
434 path.appendFormat("%s/%s/capacity", POWER_SUPPLY_SYSFS_PATH,
436 if (access(path, R_OK) == 0)
437 mHealthdConfig->batteryCapacityPath = path;
441 path.clear();
442 path.appendFormat("%s/%s/voltage_now",
444 if (access(path, R_OK) == 0) {
445 mHealthdConfig->batteryVoltagePath = path;
447 path.clear();
448 path.appendFormat("%s/%s/batt_vol",
450 if (access(path, R_OK) == 0)
451 mHealthdConfig->batteryVoltagePath = path;
456 path.clear();
457 path.appendFormat("%s/%s/current_now",
459 if (access(path, R_OK) == 0)
460 mHealthdConfig->batteryCurrentNowPath = path;
464 path.clear();
465 path.appendFormat("%s/%s/current_avg",
467 if (access(path, R_OK) == 0)
468 mHealthdConfig->batteryCurrentAvgPath = path;
472 path.clear();
473 path.appendFormat("%s/%s/charge_counter",
475 if (access(path, R_OK) == 0)
476 mHealthdConfig->batteryChargeCounterPath = path;
480 path.clear();
481 path.appendFormat("%s/%s/temp", POWER_SUPPLY_SYSFS_PATH,
483 path, R_OK) == 0) {
484 mHealthdConfig->batteryTemperaturePath = path;
486 path.clear();
487 path.appendFormat("%s/%s/batt_temp",
489 if (access(path, R_OK) == 0)
490 mHealthdConfig->batteryTemperaturePath = path;
495 path.clear();
496 path.appendFormat("%s/%s/technology",
498 if (access(path, R_OK) == 0)
499 mHealthdConfig->batteryTechnologyPath = path;