android输入设备配置文件搜索路径
来源:互联网 发布:java搞笑程序 编辑:程序博客网 时间:2024/04/29 13:11
frameworks/base/libs/ui/Input.cpp:
String8 getInputDeviceConfigurationFilePathByName( const String8& name, InputDeviceConfigurationFileType type) { // Search system repository. String8 path; path.setTo(getenv("ANDROID_ROOT"));//先搜索system目录 path.append("/usr/"); appendInputDeviceConfigurationFileRelativePath(path, name, type);//这里会根据文件类型不同添加一些前缀和后缀#if DEBUG_PROBE LOGD("Probing for system provided input device configuration file: path='%s'", path.string());#endif if (!access(path.string(), R_OK)) {#if DEBUG_PROBE LOGD("Found");#endif return path; } // Search user repository. // TODO Should only look here if not in safe mode. path.setTo(getenv("ANDROID_DATA"));//再搜索data目录 path.append("/system/devices/"); appendInputDeviceConfigurationFileRelativePath(path, name, type);#if DEBUG_PROBE LOGD("Probing for system user input device configuration file: path='%s'", path.string());#endif if (!access(path.string(), R_OK)) {#if DEBUG_PROBE LOGD("Found");#endif return path; } // Not found.#if DEBUG_PROBE LOGD("Probe failed to find input device configuration file: name='%s', type=%d", name.string(), type);#endif return String8();}
static void appendInputDeviceConfigurationFileRelativePath(String8& path, const String8& name, InputDeviceConfigurationFileType type) { path.append(CONFIGURATION_FILE_DIR[type]);//全局变量定义了配置文件目录 for (size_t i = 0; i < name.length(); i++) { char ch = name[i]; if (!isValidNameChar(ch)) { ch = '_'; } path.append(&ch, 1); } path.append(CONFIGURATION_FILE_EXTENSION[type]);//各种配置文件后缀}
static const char* CONFIGURATION_FILE_DIR[] = { "idc/", "keylayout/", "keychars/",};static const char* CONFIGURATION_FILE_EXTENSION[] = { ".idc", ".kl", ".kcm",};
根据配置文件类型不同,搜索路径会有不同。但每种配置文件都会在system/usr/和data/system/devices/两个目录下搜索相应类型文件。
- android输入设备配置文件搜索路径
- Android输入设备配置文件(.idc文件)
- android输入设备配置文件命名规则
- android输入设备配置文件加载过程分析
- Android输入设备配置文件(.idc文件)
- Android输入设备配置文件(.idc文件)介绍
- Android新增输入设备
- android 模拟输入设备
- 输入设备配置文件(.idc文件)
- 输入设备配置文件(.idc文件)
- 输入设备配置文件(.idc文件)
- 输入设备配置文件(.idc文件)
- Struts2配置文件全路径搜索的实现
- JAVA 读取properties配置文件 - 全局搜索路径
- Android Studio配置文件路径修改
- Android Studio配置文件路径修改
- Android Studio配置文件路径修改
- Android Studio配置文件路径修改
- 戴维·卡梅伦
- linux shell编程指南第十七章------条件测试
- 【ZJOI2008】 COUNT
- android 通话记录的查询与删除
- Zend-Framework - Full Info Disclosure
- android输入设备配置文件搜索路径
- 关于如何写分治法程序和递归程序
- Windows/linux双系统的时间修改问题
- C++调用C# COM组件
- android删除和查询通话记录
- 关于rmi的研究
- linux 进程的权限与用户权限及文件属性的关系
- UVA 10354 nlogn LIS
- 一个简单容器类的实现(一)