am 12b2dc90: am b1e0a870: Merge "Fix crashes caused by some input devices." into honeycomb

* commit '12b2dc90883ef4f930a17907acdef3677b0598a5':
  Fix crashes caused by some input devices.
This commit is contained in:
Jeff Brown
2011-01-25 18:22:50 -08:00
committed by Android Git Automerger
7 changed files with 102 additions and 36 deletions

View File

@ -263,10 +263,10 @@ InputDevice* InputReader::createDevice(int32_t deviceId, const String8& name, ui
device->addMapper(new CursorInputMapper(device));
}
// Touchscreen-like devices.
if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN_MT) {
// Touchscreens and touchpad devices.
if (classes & INPUT_DEVICE_CLASS_TOUCH_MT) {
device->addMapper(new MultiTouchInputMapper(device));
} else if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN) {
} else if (classes & INPUT_DEVICE_CLASS_TOUCH) {
device->addMapper(new SingleTouchInputMapper(device));
}
@ -1473,12 +1473,12 @@ void TouchInputMapper::configureParameters() {
mParameters.virtualKeyQuietTime = getPolicy()->getVirtualKeyQuietTime();
String8 deviceTypeString;
mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_SCREEN;
mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_PAD;
if (getDevice()->getConfiguration().tryGetProperty(String8("touch.deviceType"),
deviceTypeString)) {
if (deviceTypeString == "touchPad") {
mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_PAD;
} else if (deviceTypeString != "touchScreen") {
if (deviceTypeString == "touchScreen") {
mParameters.deviceType = Parameters::DEVICE_TYPE_TOUCH_SCREEN;
} else if (deviceTypeString != "touchPad") {
LOGW("Invalid value for touch.deviceType: '%s'", deviceTypeString.string());
}
}