Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45c96327 authored by Diogo Ferreira's avatar Diogo Ferreira
Browse files

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
parent 497e8031
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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)
+5 −2
Original line number Diff line number Diff line
@@ -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));