summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorDiogo Ferreira <defer@cyanogenmod.com>2011-09-03 20:24:51 +0100
committerDiogo Ferreira <defer@cyanogenmod.com>2011-09-03 21:01:48 +0100
commitaf507d8b4ef19c21d3e0079b57a265a14ed5c492 (patch)
treeddf2788cac25911afbf14d7c8dcc87192cb3b991 /libs
parent2770abd7b6d0ec565defc849a8556b074d660598 (diff)
downloadframeworks_base-af507d8b4ef19c21d3e0079b57a265a14ed5c492.zip
frameworks_base-af507d8b4ef19c21d3e0079b57a265a14ed5c492.tar.gz
frameworks_base-af507d8b4ef19c21d3e0079b57a265a14ed5c492.tar.bz2
libui: Add support for the Xperia Play jogdials
According to the Sony Ericsson SDK, the jogdials are touchpad devices. In order to register an input device as a touchpad it must have a negative display id associated to it, as per InputReader.cpp Change-Id: Idbbcab6e463ef7cefe662f67d76fb42f73d2af21
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/Android.mk2
-rw-r--r--libs/ui/InputReader.cpp12
2 files changed, 14 insertions, 0 deletions
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
index 135da75..6b249ca 100644
--- a/libs/ui/Android.mk
+++ b/libs/ui/Android.mk
@@ -44,6 +44,8 @@ else ifeq ($(TARGET_BOOTLOADER_BOARD_NAME),vision)
LOCAL_CFLAGS += -DVISION_KEYPAD
else ifeq ($(TARGET_BOOTLOADER_BOARD_NAME),speedy)
LOCAL_CFLAGS += -DVISION_KEYPAD
+else ifeq ($(TARGET_BOOTLOADER_BOARD_NAME),zeus)
+ LOCAL_CFLAGS += -DZEUS_TOUCHPADS
endif
ifeq ($(BOARD_NO_RGBX_8888),true)
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp
index 39de754..b6879dd 100644
--- a/libs/ui/InputReader.cpp
+++ b/libs/ui/InputReader.cpp
@@ -342,7 +342,19 @@ InputDevice* InputReader::createDevice(int32_t deviceId, const String8& name, ui
// Touchscreen-like devices.
if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN_MT) {
+#ifdef ZEUS_TOUCHPADS
+ /* According to the Sony Ericsson SDK, the jogdials should be interpreted
+ * as an AINPUT_SOURCE_TOUCHPAD. According to getSources() above, a
+ * touchpad is simply a device with a negative associated display id.
+ */
+ if (deviceId == 0x10004) {
+ device->addMapper(new MultiTouchInputMapper(device, -1));
+ } else {
+ device->addMapper(new MultiTouchInputMapper(device, associatedDisplayId));
+ }
+#else
device->addMapper(new MultiTouchInputMapper(device, associatedDisplayId));
+#endif
} else if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN) {
device->addMapper(new SingleTouchInputMapper(device, associatedDisplayId));
}