frameworks/base
Révision | 232fef0291c6c85c4b7a8d5493081cf8da4d03da (tree) |
---|---|
l'heure | 2011-12-15 17:49:38 |
Auteur | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
EventHub: load a default .idc if no other .idc found for touchscreen
The patch moves loadConfigurationLocked to later stage that may cause issues
if upstream changes. Needs to review it on rebasing.
@@ -852,9 +852,6 @@ int EventHub::openDevice(const char *devicePath) { | ||
852 | 852 | driverVersion >> 16, (driverVersion >> 8) & 0xff, driverVersion & 0xff); |
853 | 853 | #endif |
854 | 854 | |
855 | - // Load the configuration file for the device. | |
856 | - loadConfiguration(device); | |
857 | - | |
858 | 855 | // Figure out the kinds of events the device reports. |
859 | 856 | uint8_t key_bitmask[sizeof_bit_array(KEY_MAX + 1)]; |
860 | 857 | memset(key_bitmask, 0, sizeof(key_bitmask)); |
@@ -952,6 +949,9 @@ int EventHub::openDevice(const char *devicePath) { | ||
952 | 949 | device->classes |= INPUT_DEVICE_CLASS_SWITCH; |
953 | 950 | } |
954 | 951 | |
952 | + // Load the configuration file for the device. | |
953 | + loadConfiguration(device); | |
954 | + | |
955 | 955 | if ((device->classes & INPUT_DEVICE_CLASS_TOUCH)) { |
956 | 956 | // Load the virtual keys for the touch screen, if any. |
957 | 957 | // We do this now so that we can make sure to load the keymap if necessary. |
@@ -1043,6 +1043,10 @@ int EventHub::openDevice(const char *devicePath) { | ||
1043 | 1043 | void EventHub::loadConfiguration(Device* device) { |
1044 | 1044 | device->configurationFile = getInputDeviceConfigurationFilePathByDeviceIdentifier( |
1045 | 1045 | device->identifier, INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION); |
1046 | + if ((device->classes & INPUT_DEVICE_CLASS_TOUCH) && device->configurationFile.isEmpty()) { | |
1047 | + device->configurationFile = getInputDeviceConfigurationFilePathByName(String8("GenericTouch"), | |
1048 | + INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION); | |
1049 | + } | |
1046 | 1050 | if (device->configurationFile.isEmpty()) { |
1047 | 1051 | LOGD("No input device configuration file found for device '%s'.", |
1048 | 1052 | device->identifier.name.string()); |