您的位置:首页 > 移动开发 > Android开发

android输入设备配置文件命名规则

2013-12-07 14:00 561 查看
frameworks/base/libs/ui/Input.cpp:

String8 getInputDeviceConfigurationFilePathByDeviceIdentifier(
const InputDeviceIdentifier& deviceIdentifier,
InputDeviceConfigurationFileType type) {
if (deviceIdentifier.vendor !=0 && deviceIdentifier.product != 0) {
if (deviceIdentifier.version != 0) {
// Try vendor product version.
String8 versionPath(getInputDeviceConfigurationFilePathByName(
String8::format("Vendor_%04x_Product_%04x_Version_%04x",//先使用vender_product_version规则构成文件名搜索
deviceIdentifier.vendor, deviceIdentifier.product,
deviceIdentifier.version),
type));
if (!versionPath.isEmpty()) {
return versionPath;
}
}

// Try vendor product.
String8 productPath(getInputDeviceConfigurationFilePathByName(
String8::format("Vendor_%04x_Product_%04x",//使用vender_product查找
deviceIdentifier.vendor, deviceIdentifier.product),
type));
if (!productPath.isEmpty()) {
return productPath;
}
}

// Try device name.
return getInputDeviceConfigurationFilePathByName(deviceIdentifier.name, type);//直接使用设备名称查找
}
所以,配置文件有三种命名方式:

vender_product_ver
vender_product
device_name

每种文件均会在两个目录查找,若没有查到,则会采用下一种命名方式查找。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: