[Android] mg2195:
For those like me whose device requires legacy touch (typically touch doesn't work with out it if your device requires it) read the following, I have the hide tags due to this post being lengthy...the files that need editing (just two) are located in frameworks/base/services/input

in the android.mk add:

ifeq ($(BOARD_USE_LEGACY_TOUCHSCREEN),true)
LOCAL_CFLAGS += -DLEGACY_TOUCHSCREEN
endif

ifeq ($(BOARD_USE_LEGACY_TRACKPAD),true)
LOCAL_CFLAGS += -DLEGACY_TRACKPAD
endif

towards the bottom above

LOCAL_MODULE:= libinput

LOCAL_MODULE_TAGS := optional

and below:

LOCAL_C_INCLUDES := \
external/skia/include/core

in the InputReader.cpp add the following:

1)

#ifdef LEGACY_TOUCHSCREEN
// set true to mBtnTouch by multi-touch event with pressure more than zero
// some touchscreen driver which has BTN_TOUCH feature doesn't send BTN_TOUCH event
else if (rawEvent->type == EV_ABS && rawEvent->code == ABS_MT_TOUCH_MAJOR && rawEvent->value > 0)
mBtnTouch = true;
#endif

right above

}

uint32_t TouchButtonAccumulator::getButtonState() const {
uint32_t result = 0;
if (mBtnStylus) {
result |= AMOTION_EVENT_BUTTON_SECONDARY;
}
if (mBtnStylus2) {
result |= AMOTION_EVENT_BUTTON_TERTIARY;
}
return result;

and below:

case BTN_TOOL_QUADTAP:
mBtnToolQuadTap = rawEvent->value;
break;
}
}

2)

#ifdef LEGACY_TOUCHSCREEN
// emulate ABS_MT_PRESSURE
slot->mAbsMTPressure = rawEvent->value;
#else

right above

slot->mAbsMTTouchMajor = rawEvent->value;

and below

case ABS_MT_TOUCH_MAJOR:
slot->mInUse = true;

add

#endif

right above

break;
case ABS_MT_TOUCH_MINOR:

and below

slot->mAbsMTTouchMajor = rawEvent->value;

3)

#ifdef LEGACY_TOUCHSCREEN
// emulate ABS_MT_TOUCH_MAJOR
slot->mAbsMTTouchMajor = rawEvent->value;
#else

above

slot->mAbsMTWidthMajor = rawEvent->value;

and below

case ABS_MT_WIDTH_MAJOR:
slot->mInUse = true;

add

#endif

above

break;
case ABS_MT_WIDTH_MINOR:

and below

slot->mAbsMTWidthMajor = rawEvent->value;

4)

#ifdef LEGACY_TOUCHSCREEN
// don't use the slot with pressure less than or qeual to zero
// some touchscreen driver sends multi-touch event for not-in-use pointer
if (mSlots[mCurrentSlot].mAbsMTPressure type == EV_SYN && rawEvent->code == SYN_MT_REPORT) {

5)

#ifdef LEGACY_TRACKPAD
// sync now since BTN_MOUSE is not necessarily followed by SYN_REPORT and
// we need to ensure that we report the up/down promptly.
else if (rawEvent->type == EV_KEY && rawEvent->code == BTN_MOUSE) {
sync(rawEvent->when);
}
#endif

above

}

void CursorInputMapper::sync(nsecs_t when) {

and below

if (rawEvent->type == EV_SYN && rawEvent->code == SYN_REPORT) {
sync(rawEvent->when);
}

6)

#ifdef LEGACY_TOUCHSCREEN
getAbsoluteAxisInfo(ABS_MT_WIDTH_MAJOR, &mRawPointerAxes.touchMajor);
#else

above

getAbsoluteAxisInfo(ABS_MT_TOUCH_MAJOR, &mRawPointerAxes.touchMajor);

and below [code} getAbsoluteAxisInfo(ABS_MT_POSITION_Y, &mRawPointerAxes.y);[/code]

and add

#endif

above

getAbsoluteAxisInfo(ABS_MT_TOUCH_MINOR, &mRawPointerAxes.touchMinor);

and below

getAbsoluteAxisInfo(ABS_MT_TOUCH_MAJOR, &mRawPointerAxes.touchMajor);

7)

#ifdef LEGACY_TOUCHSCREEN
getAbsoluteAxisInfo(ABS_MT_TOUCH_MAJOR, &mRawPointerAxes.pressure);
#else

above

getAbsoluteAxisInfo(ABS_MT_PRESSURE, &mRawPointerAxes.pressure);

and below

getAbsoluteAxisInfo(ABS_MT_ORIENTATION, &mRawPointerAxes.orientation);

and add

#endif

above

getAbsoluteAxisInfo(ABS_MT_DISTANCE, &mRawPointerAxes.distance);

and below

getAbsoluteAxisInfo(ABS_MT_PRESSURE, &mRawPointerAxes.pressure);

********************************************************************************************************************************************************************

and lastly...the link to my current files with those edits for your refernce

InputReader.cpp

Android.mk

both the above files are located in frameworks/base/services/input

Appears hide doesn't work with tapatalk...sorry :/