Lines Matching refs:path
71 static EvdevDeviceNode* openDeviceNode(const std::string& path);
110 EvdevDeviceNode(const std::string& path, int fd) : in EvdevDeviceNode() argument
111 mFd(fd), mPath(path) {} in EvdevDeviceNode()
142 EvdevDeviceNode* EvdevDeviceNode::openDeviceNode(const std::string& path) { in openDeviceNode() argument
143 auto fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC)); in openDeviceNode()
145 ALOGE("could not open evdev device %s. err=%d", path.c_str(), errno); in openDeviceNode()
160 auto node = new EvdevDeviceNode(path, fd); in openDeviceNode()
164 path.c_str(), ret); in openDeviceNode()
484 status_t InputHub::registerDevicePath(const std::string& path) { in registerDevicePath() argument
485 ALOGV("registering device path %s", path.c_str()); in registerDevicePath()
486 int wd = inotify_add_watch(mINotifyFd, path.c_str(), IN_DELETE | IN_CREATE); in registerDevicePath()
488 ALOGE("Could not add %s to INotify watch. errno=%d", path.c_str(), errno); in registerDevicePath()
491 mWatchedPaths[wd] = path; in registerDevicePath()
492 scanDir(path); in registerDevicePath()
496 status_t InputHub::unregisterDevicePath(const std::string& path) { in unregisterDevicePath() argument
499 if (pair.second == path) { in unregisterDevicePath()
683 std::string path = mWatchedPaths[event->wd]; in readNotify() local
684 path.append("/").append(event->name); in readNotify()
685 ALOGV("inotify event for path %s", path.c_str()); in readNotify()
688 auto deviceNode = openNode(path); in readNotify()
690 ALOGE("could not open device node %s. err=%zd", path.c_str(), res); in readNotify()
695 auto deviceNode = findNodeByPath(path); in readNotify()
699 ALOGW("Could not close device %s. errno=%d", path.c_str(), ret); in readNotify()
704 ALOGW("could not find device node for %s", path.c_str()); in readNotify()
716 status_t InputHub::scanDir(const std::string& path) { in scanDir() argument
717 auto dir = ::opendir(path.c_str()); in scanDir()
719 ALOGE("could not open device path %s to scan for devices. err=%d", path.c_str(), errno); in scanDir()
728 std::string filename = path + "/" + dirent->d_name; in scanDir()
740 std::shared_ptr<InputDeviceNode> InputHub::openNode(const std::string& path) { in openNode() argument
741 ALOGV("opening %s...", path.c_str()); in openNode()
742 auto evdevNode = std::shared_ptr<EvdevDeviceNode>(EvdevDeviceNode::openDeviceNode(path)); in openNode()
748 ALOGV("opened %s with fd %d", path.c_str(), fd); in openNode()
803 std::shared_ptr<InputDeviceNode> InputHub::findNodeByPath(const std::string& path) { in findNodeByPath() argument
805 if (pair.second->getPath() == path) return pair.second; in findNodeByPath()