summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorDiogo Ferreira <defer@cyanogenmod.com>2011-11-05 15:16:04 +0000
committerDiogo Ferreira <defer@cyanogenmod.com>2011-11-05 15:16:04 +0000
commit45c96327a4ded69a9a90b9c15d55fb3feb3c005f (patch)
tree3efb1736d15c138664ca15bb5d19016c3d02b2fb /libs
parent497e8031a48d0ed71835903b836a394ad017c2fc (diff)
downloadframeworks_base-45c96327a4ded69a9a90b9c15d55fb3feb3c005f.zip
frameworks_base-45c96327a4ded69a9a90b9c15d55fb3feb3c005f.tar.gz
frameworks_base-45c96327a4ded69a9a90b9c15d55fb3feb3c005f.tar.bz2
framework: Add a board option to specify a touchpad input id
zeus and zeusc (Xperia play gsm/cdma) have a synaptics touchpad that is detected as a touchscreen. The InputReader has the facilities to handle touchpads but the are not used. This patch adds TARGET_TOUCHPAD_INPUT_DEVICE_ID, a boardconfig option that allows devices to specify the input device id of the touchpad and they should work correctly. This also removes the previous touchpad code that was exclusive to the zeus board and which will now be moved to the device repository. Change-Id: Ib1ff12af87e5da8ba334f8fa14fa8ba8ee034800
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/Android.mk6
-rw-r--r--libs/ui/InputReader.cpp7
2 files changed, 9 insertions, 4 deletions
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
index 6b249ca..00fee24 100644
--- a/libs/ui/Android.mk
+++ b/libs/ui/Android.mk
@@ -44,8 +44,10 @@ 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
+
+ifneq ($(TARGET_TOUCHPAD_INPUT_DEVICE_ID),)
+ LOCAL_CFLAGS += -DTOUCHPAD_INPUT_DEVICE_ID=$(TARGET_TOUCHPAD_INPUT_DEVICE_ID)
endif
ifeq ($(BOARD_NO_RGBX_8888),true)
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp
index 23fb533..4cd24859 100644
--- a/libs/ui/InputReader.cpp
+++ b/libs/ui/InputReader.cpp
@@ -342,12 +342,15 @@ InputDevice* InputReader::createDevice(int32_t deviceId, const String8& name, ui
// Touchscreen-like devices.
if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN_MT) {
-#ifdef ZEUS_TOUCHPADS
+#ifdef TOUCHPAD_INPUT_DEVICE_ID
/* 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.
+ *
+ * This is also available to others who need input touchpads to be
+ * recognized as such and not as a regular touchscreen.
*/
- if (deviceId == 0x10004) {
+ if (deviceId == TOUCHPAD_INPUT_DEVICE_ID) {
device->addMapper(new MultiTouchInputMapper(device, -1));
} else {
device->addMapper(new MultiTouchInputMapper(device, associatedDisplayId));