Lines Matching defs:path

95 int BatteryMonitor::readFromFile(const String8& path, char* buf, size_t size) {
98 if (path.isEmpty())
100 int fd = open(path.string(), O_RDONLY, 0);
102 KLOG_ERROR(LOG_TAG, "Could not open '%s'\n", path.string());
119 BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) {
122 int length = readFromFile(path, buf, SIZE);
147 bool BatteryMonitor::getBooleanField(const String8& path) {
152 if (readFromFile(path, buf, SIZE) > 0) {
161 int BatteryMonitor::getIntField(const String8& path) {
166 if (readFromFile(path, buf, SIZE) > 0) {
216 String8 path;
217 path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH,
220 if (readFromFile(path, buf, SIZE) > 0) {
222 path.clear();
223 path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH,
225 switch(readPowerSupplyType(path)) {
276 String8 path;
293 path.clear();
294 path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name);
295 switch(readPowerSupplyType(path)) {
299 path.clear();
300 path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, name);
301 if (access(path.string(), R_OK) == 0)
307 path.clear();
308 path.appendFormat("%s/%s/status", POWER_SUPPLY_SYSFS_PATH,
310 if (access(path, R_OK) == 0)
311 mHealthdConfig->batteryStatusPath = path;
315 path.clear();
316 path.appendFormat("%s/%s/health", POWER_SUPPLY_SYSFS_PATH,
318 if (access(path, R_OK) == 0)
319 mHealthdConfig->batteryHealthPath = path;
323 path.clear();
324 path.appendFormat("%s/%s/present", POWER_SUPPLY_SYSFS_PATH,
326 if (access(path, R_OK) == 0)
327 mHealthdConfig->batteryPresentPath = path;
331 path.clear();
332 path.appendFormat("%s/%s/capacity", POWER_SUPPLY_SYSFS_PATH,
334 if (access(path, R_OK) == 0)
335 mHealthdConfig->batteryCapacityPath = path;
339 path.clear();
340 path.appendFormat("%s/%s/voltage_now",
342 if (access(path, R_OK) == 0) {
343 mHealthdConfig->batteryVoltagePath = path;
345 path.clear();
346 path.appendFormat("%s/%s/batt_vol",
348 if (access(path, R_OK) == 0)
349 mHealthdConfig->batteryVoltagePath = path;
354 path.clear();
355 path.appendFormat("%s/%s/current_now",
357 if (access(path, R_OK) == 0)
358 mHealthdConfig->batteryCurrentNowPath = path;
362 path.clear();
363 path.appendFormat("%s/%s/charge_counter",
365 if (access(path, R_OK) == 0)
366 mHealthdConfig->batteryChargeCounterPath = path;
370 path.clear();
371 path.appendFormat("%s/%s/temp", POWER_SUPPLY_SYSFS_PATH,
373 if (access(path, R_OK) == 0) {
374 mHealthdConfig->batteryTemperaturePath = path;
376 path.clear();
377 path.appendFormat("%s/%s/batt_temp",
379 if (access(path, R_OK) == 0)
380 mHealthdConfig->batteryTemperaturePath = path;
385 path.clear();
386 path.appendFormat("%s/%s/technology",
388 if (access(path, R_OK) == 0)
389 mHealthdConfig->batteryTechnologyPath = path;