Lines Matching refs:path
85 static EvdevDeviceNode* openDeviceNode(const std::string& path);
124 EvdevDeviceNode(const std::string& path, int fd) : in EvdevDeviceNode() argument
125 mFd(fd), mPath(path) {} in EvdevDeviceNode()
156 EvdevDeviceNode* EvdevDeviceNode::openDeviceNode(const std::string& path) { in openDeviceNode() argument
157 auto fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC)); in openDeviceNode()
159 ALOGE("could not open evdev device %s. err=%d", path.c_str(), errno); in openDeviceNode()
174 auto node = new EvdevDeviceNode(path, fd); in openDeviceNode()
178 path.c_str(), ret); in openDeviceNode()
498 status_t InputHub::registerDevicePath(const std::string& path) { in registerDevicePath() argument
499 ALOGV("registering device path %s", path.c_str()); in registerDevicePath()
500 int wd = inotify_add_watch(mINotifyFd, path.c_str(), IN_DELETE | IN_CREATE); in registerDevicePath()
502 ALOGE("Could not add %s to INotify watch. errno=%d", path.c_str(), errno); in registerDevicePath()
505 mWatchedPaths[wd] = path; in registerDevicePath()
506 scanDir(path); in registerDevicePath()
510 status_t InputHub::unregisterDevicePath(const std::string& path) { in unregisterDevicePath() argument
513 if (pair.second == path) { in unregisterDevicePath()
698 std::string path = mWatchedPaths[event->wd]; in readNotify() local
699 path.append("/").append(event->name); in readNotify()
700 ALOGV("inotify event for path %s", path.c_str()); in readNotify()
703 auto deviceNode = openNode(path); in readNotify()
705 ALOGE("could not open device node %s. err=%d", path.c_str(), res); in readNotify()
710 auto deviceNode = findNodeByPath(path); in readNotify()
714 ALOGW("Could not close device %s. errno=%d", path.c_str(), ret); in readNotify()
719 ALOGW("could not find device node for %s", path.c_str()); in readNotify()
731 status_t InputHub::scanDir(const std::string& path) { in scanDir() argument
732 auto dir = ::opendir(path.c_str()); in scanDir()
734 ALOGE("could not open device path %s to scan for devices. err=%d", path.c_str(), errno); in scanDir()
743 std::string filename = path + "/" + dirent->d_name; in scanDir()
755 std::shared_ptr<InputDeviceNode> InputHub::openNode(const std::string& path) { in openNode() argument
756 ALOGV("opening %s...", path.c_str()); in openNode()
757 auto evdevNode = std::shared_ptr<EvdevDeviceNode>(EvdevDeviceNode::openDeviceNode(path)); in openNode()
763 ALOGV("opened %s with fd %d", path.c_str(), fd); in openNode()
818 std::shared_ptr<InputDeviceNode> InputHub::findNodeByPath(const std::string& path) { in findNodeByPath() argument
820 if (pair.second->getPath() == path) return pair.second; in findNodeByPath()