[Xperia Play Android Development] farenheith:
For the devs compiling their ROMs from source, i'm trying to make instructions to modify directly those source. I'm unable to compile android from source as I'm on Windows, so I can't test it. But, if anyone interested want it, here is the steps:

Create the interface android.view.ViewRoot with the following code:

package android.view;

public interface ViewRoot {
public void setProcessPositionEvents(boolean b);
}

Make ViewRootImpl implements ViewRoot like this:

public final class ViewRootImpl implements ViewParent,
View.AttachInfo.Callbacks, HardwareRenderer.HardwareDrawCallbacks, [COLOR="Red"]ViewRoot[/COLOR] {

Insert this method on ViewRootImpl:

public void setProcessPositionEvents(boolean b){
if (android.os.Build.BRAND.startsWith("SEMC") && android.os.Build.MODEL.startsWith("R800")){
if (mView != null)
mView.setProcessGenericMotionAsPointer(b);
} else {
throw new Exception("Device is not a Xperia Play");
}
}

Insert this code on View:

private boolean mProcessGenericMotionAsPointer = false;

public void setProcessGenericMotionAsPointer(boolean b){
mProcessGenericMotionAsPointer = b;
}

public int sendTreatAsTouchEvent(MotionEvent event){
int ret = 0;
boolean doIt = false;
if (android.os.Build.BRAND.startsWith("SEMC") && android.os.Build.MODEL.startsWith("R800")){
doIt = event.getSource() == InputDevice.SOURCE_TOUCHPAD;
if (doIt){
doIt = mProcessGenericMotionAsPointer;
if (!doIt) {
doIt = (boolean)android.os.SystemProperties.getInt("mod.touchpad.activated",0);
}
if (doIt) {
ret = (dispatchTouchEvent(event) ? 1 : 2);
}
}
}
return ret;
}

Change the dispatchGenericMotionEvent like this:

public boolean dispatchGenericMotionEvent(MotionEvent event) {
[COLOR="red"]int ret = sendTreatAsTouchEvent(event);
if (ret != 0){
return (ret == 1 ? true : false);
}[/COLOR]
... ... ...

In the MotionEvent, look for every call of nativeGetAxisValue and change this to _nativeGetAxisValue. BE CAREFUL! Don't change the declaration of the native method nativeGetAxisValue

Now, add this methods to MotionEvent.java

private boolean mustAddPointerId(){
return ((getSource() == InputDevice.SOURCE_TOUCHPAD) &&
(android.os.SystemProperties.getInt("mod.touchpad.startfrom1",0) == 1));
}

private float _nativeGetAxisValue(int nativePtr,
int axis, int pointerIndex, int historyPos){
int cnt = getPointerCount();
if (cnt > 0)
pointerIndex = (pointerIndex % cnt);
return nativeGetAxisValue(nativePtr, axis, pointerIndex, historyPos);
}

Change this methods at the MotionEvent

public final int findPointerIndex(int pointerId) {
[COLOR="red"]if (mustAddPointerId() && pointerId > 0)
pointerId--;
[/COLOR]
return nativeFindPointerIndex(mNativePtr, pointerId);
}

public final int getPointerId(int pointerIndex) {
[COLOR="Red"]int ret = [/COLOR]nativeGetPointerId(mNativePtr, pointerIndex);
[COLOR="red"]if (mustAddPointerId())
ret++;
return ret;[/COLOR]
}

public final int getPointerIdBits() {
int idBits = 0;
final int pointerCount = nativeGetPointerCount(mNativePtr);
for (int i = 0; i < pointerCount; i++) {
idBits |= 1 << [COLOR="Red"]getPointerId(i);[/COLOR]
}
return idBits;
}

Rename the method split to split2 and insert this method:

public final MotionEvent split(int idBits) {
if (mustAddPointerId())
idBits = idBits >> 1;
return split2(idBits);
}

This version of the fix is implemented in the the PACman ROM v4. I need some others to implement this one so we can make sure the instructions here is all ok (as I helped the implementation, maybe I forgot to update something here).