[BETA][ICS][JB]Touchpad support improvement V 1.1

Search This thread

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
Yeah, I know the reason the touchpad no longer dispatch a touch event. The idea of the fix of this thread is to keep a legacy behavior for all the Xperia Play compatible apps. Unfortunately, expect the app developers to make the touchpad support compatible with newer versions of Android is not a real option, as there's no official new Android for the Xperia Play and it's not commercial attractive anymore, so, the only options is hack the framework or let it go.

And look, the NativeActivity is not the correct way to do it, it's only one of the ways and also the only way that works with unofficial AOSP based ROMs without any hack. Doing it through framework using the Sony modifications is also a valid way, supported by Sony and stuff, that's why a lot of game developers used it, but this method doesn't work on unifficial AOSP based ROMs, and that's the point of the fix: make it work. That's also the reason for Sony to maintain this behavior on their ICS Beta ROM.

Regardless, I do understand that the fix is not working anymore with kitkat as it worked with Jellybean and I appreciate your attention.

For the XPlay owners:

If this fix does not work anymore, then you will need a new one or someone to analyse the code again. When I did it, I look into the 'lara croft and the guardian of light' decompiled source. It was not hard to guess how to trick the app and make the touchpad work again, you just need to learn a little bit of Smali and do some tests with a recompiled framework to find out what is wrong. But the device is needed to do it.

I'm sorry I can't help more, but I wish somone find a way to make it work again.

Best regards!
 

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
Actually I was trying to help the ones that still have a Xperia play, but without the device I can't do much.

And maybe I expressed wrong: the native activity implementation is valid, but is not the only valid one. The fix of this thread was not made upon speculation, more like investigation. I don't have a documentation but I did look into the official source code, and also in many apps that implements the touchpad, and this fix was tested and validated on a lot of them, you can see on post 2. And I remember of an email to the Sony developers discussing exactly this (because of a lag on jb, probably), but it's pointless to look for it. It is lost on some page of this thread and will not help anyone right now. And I actually... I can't test the fix as I don't have the device, I stated it was not working based on a previous post. I'll take a look on it to confirm.
 
Last edited:

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
I gave up on trying to explain how to fix support. It's great you want to stay involved without access to the device, but replying to a post explaining how to update support from a dev who does have access by saying someone needs to find a new solution... ???
I think you got me wrong. I don't know if you have access to device or not, neither your priorities. I didn't mean to offend you. But if this fix is obsolete, then a new solution is needed, and I didn't say it directly to you, but to anyone reading. I just said this because it doesn't need to be you or anyone in particular to look into this, not because you're not capable of, but because you already have your projects, I just didn't want to sound demanding.

Edit: @julian280, did you test anything? I was assuming it was not working but maybe I just didn't get what you said before.
 
Last edited:
I think you got me wrong. I don't know if you have access to device or not, neither your priorities. I didn't mean to offend you. But if this fix is obsolete, then a new solution is needed, and I didn't say it directly to you, but to anyone reading. I just said this because it doesn't need to be you or anyone in particular to look into this, not because you're not capable of, but because you already have your projects, I just didn't want to sound demanding.

Edit: @julian280, did you test anything? I was assuming it was not working but maybe I just didn't get what you said before.


I'm not offended in the least. I posted all the info I have somewhere it won't be confusing to anyone looking for a framework modification. Best of luck.


Sent from my iPad using Tapatalk
 

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
@julian280, I just remembered something, when you read it. If this still doesn't work, look into the build.prop. there are some changes you need to do there, described on the main post. This changes + the modded framework are needed to make the mod work. Sorry for not remember it before.
 
Last edited:
  • Like
Reactions: julian280

julian280

Senior Member
Jul 29, 2012
144
42
Bogotá D.C
I did the changes but not all lines that must be changed are present in CM11 build.prop, so I only changed the ones thar are present, plus adding the mod.touchpad.startfrom1=1

Must I add the ro.semc..... lines (which are not present)?
Didnt have time to add them when I tried this mod (I'm busy wirh college these days) but I will try that tonight if I got some spare time

Sent from my D5503 using XDA Free mobile app
 

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
I did the changes but not all lines that must be changed are present in CM11 build.prop, so I only changed the ones thar are present, plus adding the mod.touchpad.startfrom1=1

Must I add the ro.semc..... lines (which are not present)?
Didnt have time to add them when I tried this mod (I'm busy wirh college these days) but I will try that tonight if I got some spare time

Sent from my D5503 using XDA Free mobile app
Yeah, actually you need to add it.

Most of the Xperia Optimized games check those properties to know if the device is really a Xperia Play and then execute the expected behavior. The properties verified vary from app to app, but mostly is ro.build.product, the ro.semc ones, ro.product.manufacturer and/or ro.product.brand.

Some games (like Max Payne) even check the SDK version to make sure they're running on Gingerbread, but this info you can't change or the system will break, so these ones need the touchpad activator.

But make sure the tested app is Xperia Play optimized, preferably listed on post 2 as a working one.
 
Last edited:

farenheith

Senior Member
Apr 5, 2011
858
423
Carapicuíba
Unfortunately not from my own. I did this fix a long time ago and I don't have a xperia play with me anymore, but the source code of the fix is available and someone with access to such device can do it or even include the fix in the CM13 or Lineage 14 :).

The sourcecode is in the main post in a zip file in media fire, but I'll put it in github to make access easier :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 58
    Hello guys.

    First of all, I need to say something about the touchpad implementation:
    there's many ways to implement the touchpad on the Xperia Play. Some of these ways works with CM9, and somes works only with the Sony's framework. This is a little obviously, as some games recognize the touchpad on CM9, and others don't.

    I know about the fix we can make on the build.prop. But this will only work with the games that do a check on the device model and implements the touchpad in a compatible way with CM9.

    FAQ

    Why (programmatically) some games that uses touchpad does not work on CM9/CM10?
    I can't say about all games, but some games uses the event onTouchEvent of the classes View or Activity to get the touchpad return. The CM9 does not support this return on this event. What Sony did on their framework is a way to activate the touchpad return over this event, that's not present on AOSP

    What this fix does?
    This fix change the CM9/CM10 framework.jar to, transparently, activate the touchpad return on the onTouchEvent. So, the games that uses this method to recognize the touchpad will begin to work.

    How I use this fix?
    FOR ICS USERS
    FIRST: EDIT YOUR BUILD.PROP
    First of all, you need to edit the build.prop because many games use some properties there to recognize the phone as a Xperia play! There's no a real rule, so, some games can look to one property, and others to another. Here you can take a look in what to do. Also, edit the build.prop can solve the circle button problem. here you can read why.

    SECOND: FLASH THE ZIP
    Do a nandroid backup and, then, flash the appropriated zip for your android version.

    THIRD: INSTALL THE TOUCHPADACTIVATOR (FOR VERSION 0.6+)
    Some games just can't activate the touchpads because some verifications that it did, like compare if the SDK Version é lesser than 13. Change this property and some others can cause many problems on the phone, so, I created an app to switch when the game need to activate the touchpad and when it's always activated. SOME APPS HAVE PROBLEMS TO DEAL WITH THE TOUCHPAD WHEN IT'S ALWAYS ACTIVATED, LIKE FPSE, so, with this app, you can switch the touchpad behavior as you need.

    IMPORTANT:DO THE BACKUP OF YOUR FRAMEWORK.JAR, DO NOT DELETE IT, JUST IN CASE. If you want, you can do a nandroid backup to be more safe.


    FOR JB USERS For now, you need to edit the ROM flashable zip. Extract the framework.jar from the JB fix and replace directly on the system/framework folder of the ROM zip. Then, extract the build.prop from the ROM zip, do the described changes, and put it back. After that, flashthe edited ROM zip and install the touchpad activator. The flashable zip is not working, idk why yet. For now, this is the only supported way until I can solve this.

    The 'ALWAYS ACTIVATED' behavior that we can choose in the TouchpadActivator app can drain the battery life?
    No. The battery life is not influenced by the chosen behavior. The term "ALWAYS ACTIVATED" just means that the touchpad events is always forwarded to the onTouchEvent, but the device is always listen to the touchpad doesn't matter what behavior you choose! (even without this fix)

    What ROMs supports this fix?
    It can works on CM9/CM10 based ROMs, you need to try to be sure. I tested it on CM10 FXP137 and CM9 FXP138, and maybe the creator of some custom ROM did changes on the framework for himself, and then this fix can be incompatible with his ROM, and it's very likely.
    ROMs based on CM7 will not work with this fix because I'm using a new feature of the ICS.

    Which games is fixed with this fix?
    See post #3

    This fix solve once for all the touchpad issues of CM9?
    I can't say that. Maybe there's other way to get the touchpad return that is not compatible with CM9 already. Maybe Sony will do a update and change this rules. Only time will telll

    My phone brick! What can I do now?
    Restore your nandroid backup or rename back the old framework.jar. Just to be clear: I'm not responsible for any bricks or problems of your phone.

    After apply the fix, some apps gives FC. Why?
    Some games and apps gives FC if their data is downloaded before the fix. It's normal. Try the app a second time, it works on almost every time. If it's keeping FC, then clear the app data and try again. Remember that some games download the data in two steps (first part download, then the app is closed and you need to open it again to proceed). If even with this the app keeping FC, post a logcat on this thread, the ROM you're using, what app is giving those troubles and any other info that you think it's useful.


    The touchpad is not recognizing at all. Why?
    As I need to make many tests and reboot the phone... It's very likely that I let the gamepad slided down. But, after some pain I realize that when I didn't slide down the gamepad after the reboot, the touchpad doesn't work (That is, the gamepad was already slided down, so, I didn't do it after the reboot). So, if anyone experiencing this problem, just slide up and down the gamepad and test again. This is the only situation that something like that happened to me.

    What is PointerID?
    pointerID is just an identification for your finger when it is touching the touchpad. It's a way to the phone know what is each finger. On GB, this ID start at 1 (finger 1, finger 2, etc...). On ICS, it start at 0 (finger 0, finger 1...). Some games do some shameful validation based that the first id will always be 1 and then get problems on GB. This is why this option is included. As it is a new resource and I'm considering it experimental, when you reboot the phone the pointerID will allways be setted to start at 0.

    The pointerid starting at 1 is working better than starting at 0. Can this be the default behavior?
    Yes, you can set the pointerid starting at 1 as the default behavior. Just put on the build.prop this: mod.touchpad.startfrom1 = 1. You can do this by yourself if you feel that this new behavior is better than the default one. The idea is remove this switcher and let the pointerID permanently starting at 1 (as it is on GB), but I need to do some tests to make sure that all will work okay.

    There's a GB version planned for the future?
    No. I'll not make a GB version for this fix, for two reasons:
    1 - It's a completely different fix. The concept of this fix is based on the onGenericMotionEvent, that exists since ICS. To make a GB version we need to analyse the stock GB support for touchpad entirely, not just the framework java code, and probably will be only possible to implement directly in the sources.

    2 - I don't have interest. I think we have to look forward, and we have GB ROMs good enough for gaming. Also soon, with the V 3.0 of the turbo kernel, we can make a dual boot with GB and desired ROM and then use GB just for games.

    Do I need to install the touchpad activator?
    No. You don't need. Editing the build.prop and flashing the zip/replacing the framework probable will be enough to get good results. BUT some games need to be tricked to get the touchpad working. For example: Max Payne checks the SDK version to activate or not the touchpad. You can't change the SDK Version in the build.prop, otherwise you'll get big problems (like the data partition wiped) when you reboot the ROM. So, to avoid this problem, you need to set the touchpad behavior, in the touchpad activator, to ALWAYS ACTIVATED. The option to set the pointer ID s becoming obsolete, because every game should work with pointerID starting at 1. The next version of the activator will not have this property anymore and this option will be setted directly in the build.prop

    IS VERY RECOMMENDED TO INCLUDE IN THE BUILD.PROP THE FOLLOWING LINE
    Code:
    mod.touchpad.startfrom1=1
    This option doesn't affected any tested game and can improve the touchpad compability in anothers

    DOWNLOAD
    CM9 Version 1.1 (Flashable zip) for FXP 147 or later here
    CM9 Version 1.1 (Flashable zip) for FXP 146 or less here

    CM10 FXP149 or later Version 1.1 (not flashable zip! replace the file in the ROM zip) here

    AOKP-ICS Version 1.0 here

    AOKP-JB Version 1,1 (not flashable zip) here

    Paranoid-ICS Version 1.0 here

    TouchpadActivator V 1.3 (apk): here (Have test for app side activation and pointer ID switch)
    TouchpadActivator V 1.1 (apk): here

    TouchpadActivator V 1.3 (Source): here
    TouchpadActivator V 1.1 (Source): here

    FIX FOR Markphyton ROM This fix will add the ALWAYS ACTIVATED behavior. You need to replace the framework files with the ones on the zip (THIS IS NOT A FLASHABLE ZIP) and delete any .odex of the framework folder. Also, install the TouchpadActivator to change the touchpad behavior

    THANKS TO:
    CosmicDan, for the support and the help with Sony framework!
    cj360 for the AOKP-ICS version 0.4
    wedgess, for the help with the java edit instructions!

    THANKS TO THE PEOPLE HELPING TO TEST THIS FIX (I tried to list all the ones that gave me some feedback. If I forgot someone, please, tell me :))
    abrahamt24, bamsbamx, benben972, chery2k, CosmicDan, Dany XP, gopin, hitman980206, jimmyvau, karma123, Lordomn, MilkyJoePD, olokos, solomon4400, thi3um, wuby
    24
    Instructions to change the framework.jar FOR DEVS


    IF YOU WANT EQUIVALENT INSTRUCTIONS TO EDIT JAVA SOURCODE, TAKE A LOOK HERE

    VERSION 1.1
    CHANGES:
    V 1.2 Now, the changes on the View.smali checks if the device is a Xperia PLAY. So, the framework edited can be used on other compatible devices without side effects
    V 1.1 Added support to switch the initial pointerId for the touchpad
    V 1.0 The implementation follow the Sony framework source code now, but probably we'll not feel any difference on the touchpad support (probably)
    V0.6 Created support to the property mod.touchpad.activated to set when the touchpad is always activated and when the game need to activate it. Also, it's offer support to the app TouchpadActvation.apk
    V0.5 Touchpad activation implemented
    V0.4
    The ViewRoot method is not static anymore and return void
    The new class ViewRoot is now parent of ViewRootImpl.
    The dispatchGenericMotionEvent had been modified on other classes, the verification of BIND_TOUCHPAD_ONTOUCH is removed

    First, you need to decompile the framework, I'm using Virtuous Ten studio to do it. This IDE use the apktool to generate the code, so, to everyone using apktool too, the code will be the same.

    Now, make the following steps:

    INSTRUCTIONS
    • Copy the ViewRoot.smali from the attachment to the /android/view folder of the decompiled framework.
    • At the beginning of the ViewRootImpl.smali, insert the line in red:


      Code:
      # interfaces
      .implements Landroid/view/ViewParent;
      .implements Landroid/view/View$AttachInfo$Callbacks;
      .implements Landroid/view/HardwareRenderer$HardwareDrawCallbacks;
      [B][COLOR="Red"].implements Landroid/view/ViewRoot;[/COLOR][/B]

    • Then, still on ViewRootImpl.smali, insert this method at the end of the file
      Code:
      .method public setProcessPositionEvents(Z)V
          .locals 1
      
          iget-object v0, p0, Landroid/view/ViewRootImpl;->mView:Landroid/view/View;
      
          if-eqz v0, :cond_9
      
          iget-object v0, p0, Landroid/view/ViewRootImpl;->mView:Landroid/view/View;
      
          invoke-virtual {v0, p1}, Landroid/view/View;->setProcessGenericMotionAsPointer(Z)V
      
          :cond_9
          return-void
      .end method
    • Insert this method at the end of the View.smali:
      Code:
      .method public sendTreatAsTouchEvent(Landroid/view/MotionEvent;)I
          .locals 6
          .parameter "event"
      
          .prologue
          const/4 v3, 0x0
      
          const/4 v2, 0x1
      
          const/4 v1, 0x0
      
          const/4 v0, 0x0
      
          sget-object v4, Landroid/os/Build;->BRAND:Ljava/lang/String;
      
          const-string v5, "SEMC"
      
          invoke-virtual {v4, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
      
          move-result v4
      
          if-eqz v4, :cond_3b
      
          sget-object v4, Landroid/os/Build;->MODEL:Ljava/lang/String;
      
          const-string v5, "R800"
      
          invoke-virtual {v4, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
      
          move-result v4
      
          if-eqz v4, :cond_3b
      
          invoke-virtual {p1}, Landroid/view/MotionEvent;->getSource()I
      
          move-result v4
      
          const v5, 0x100008
      
          if-ne v4, v5, :cond_3c
      
          move v0, v2
      
          :goto_22
          if-eqz v0, :cond_3b
      
          iget-boolean v0, p0, Landroid/view/View;->mProcessGenericMotionAsPointer:Z
      
          if-nez v0, :cond_32
      
          const-string/jumbo v4, "mod.touchpad.activated"
      
          invoke-static {v4, v3}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
      
          move-result v4
      
          if-ne v4, v2, :cond_3e
      
          move v0, v2
      
          :cond_32
          :goto_32
          if-eqz v0, :cond_3b
      
          invoke-virtual {p0, p1}, Landroid/view/View;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z
      
          move-result v3
      
          if-eqz v3, :cond_40
      
          move v1, v2
      
          :cond_3b
          :goto_3b
          return v1
      
          :cond_3c
          move v0, v3
      
          .line 17967
          goto :goto_22
      
          :cond_3e
          move v0, v3
      
          goto :goto_32
      
          :cond_40
          const/4 v1, 0x2
      
          goto :goto_3b
      .end method
      
      .method setProcessGenericMotionAsPointer(Z)V
          .locals 0
      
          iput-boolean p1, p0, Landroid/view/View;->mProcessGenericMotionAsPointer:Z
      
          return-void
      .end method
    • Still on View.smali, insert the property in red:
      Code:
      .field private mPerformClick:Landroid/view/View$PerformClick;
      
      [B][COLOR="red"].field private mProcessGenericMotionAsPointer:Z[/COLOR][/B]
      
      .field mPrivateFlags:I
    • Finnally, insert this lines on the dispatchGenericMotionEvent (in red):
      Code:
      .method public dispatchGenericMotionEvent(Landroid/view/MotionEvent;)Z
          .locals 5
          .parameter "event"
      
          .prologue
          const/4 v3, 0x0
      
          const/4 v2, 0x1
      
      [B][COLOR="red"]    invoke-virtual {p0, p1}, Landroid/view/View;->sendTreatAsTouchEvent(Landroid/view/MotionEvent;)I
      
          move-result v1
      
          .line 7184
          if-eqz v1, :cond_g
          
          sub-int v2, v1, v2
      
          goto :goto_3b
          
          [COLOR="SeaGreen"]<<<<< ATTENTION, THIS goto MUST BE EXACTLY THE SAME COMMAND OF THE LAST LINE OF THE METHOD[/COLOR]
      
          :cond_g[/COLOR][/B]
          .line 5597
          iget-object v4, p0, Landroid/view/View;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;
      
          ... ... ... (THE CODE OF THE METHOD) ... ... ...
      .end method
    • FOR SWITCH THE START POINTER ID FOR THE TOUCHPAD
    • Add this methods to the end of the android/view/MotionEvent:
      Code:
      .method public addPointerId(I)I
          .locals 2
          .parameter "pointerId"
          
          .prologue
          
          move v0, p1
          
          invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
          
          move-result v1
          
          if-eqz v1, :cond_1
      
          const/4 v1, 0x1
          
          add-int/2addr v0, v1
          
          :cond_1
          return v0
      .end method
      
      .method public modPointerId(I)I
          .locals 2
          .parameter "pointerId"
          
          .prologue
          
          move v0, p1
          
          invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
          
          move-result v1
          
          if-eqz v1, :cond_1
      
          const/4 v1, 0x1
          
          invoke-virtual {p0}, Landroid/view/MotionEvent;->getPointerCount()I
          
          move-result v1
          if-lt v0, v1, :cond_1
          
          const/4 v0, 0x0
      
          :cond_1
          return v0
      .end method
      
      .method public subPointerId(I)I
          .locals 2
          .parameter "pointerId"
          
          .prologue
          
          move v0, p1
          
          if-eqz v0, :cond_1
          
          invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
          
          move-result v1
          
          if-eqz v1, :cond_1
      
          const/4 v1, 0x1
          
          sub-int/2addr v0, v1
          
          :cond_1
          return v0
      .end method
      
      .method public pointerIdStartFrom1Plus()I
          .locals 3
      
          .prologue
          
          const/4 v2, 0x0
          
          invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1()I
          
          move-result v0
          
          if-eqz v0, :cond_1
      
          sget v0, Landroid/view/InputDevice;->SOURCE_TOUCHPAD:I
          
          invoke-virtual {p0}, Landroid/view/MotionEvent;->getSource()I
          
          move-result v1
          
          if-ne v0, v1, :cond_1
          
          const/4 v2, 0x1
      
          :cond_1
          return v2
      .end method
      
      .method public pointerIdStartFrom1()I
          .locals 2
          
          .prologue
          
          const/4 v0, 0x0
      
          const-string/jumbo v1, "mod.touchpad.startfrom1"
      
          invoke-static {v1, v0}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
      
          move-result v0
      
          return v0
      .end method
    • Add (or change) the lines in red to the following methods:
      Code:
      .method public final getPointerId(I)I
          .locals 2
          .parameter "pointerIndex"
      
          .prologue
          .line 1927
          iget v0, p0, Landroid/view/MotionEvent;->mNativePtr:I
      
          invoke-static {v0, p1}, Landroid/view/MotionEvent;->nativeGetPointerId(II)I
      
          move-result v0
      
      [COLOR="red"]    invoke-virtual {p0, v0}, Landroid/view/MotionEvent;->addPointerId(I)I
          
          move-result v0[/COLOR]
          
          return v0
      .end method
      
      ... ... ...
      
      .method public final getPointerIdBits()I
          .locals 5
      
          .prologue
          .line 2786
          const/4 v1, 0x0
      
          .line 2787
          .local v1, idBits:I
          iget v3, p0, Landroid/view/MotionEvent;->mNativePtr:I
      
          invoke-static {v3}, Landroid/view/MotionEvent;->nativeGetPointerCount(I)I
      
          move-result v2
      
          .line 2788
          .local v2, pointerCount:I
          const/4 v0, 0x0
      
          .local v0, i:I
          :goto_0
          if-ge v0, v2, :cond_0
      
          .line 2789
      [COLOR="red"]
          invoke-virtual {p0, v0}, Landroid/view/MotionEvent;->getPointerId(I)I
      [/COLOR]
          move-result v4
      
          shl-int/2addr v3, v4
      
          or-int/2addr v1, v3
      
          .line 2788
          add-int/lit8 v0, v0, 0x1
      
          goto :goto_0
      
          .line 2791
          :cond_0
          return v1
      .end method
      
      ... ... ...
      
      .method public final getX(I)F
      [COLOR="red"]    .locals 4[/COLOR]
          .parameter "pointerIndex"
      
          .prologue
          .line 1974
          [COLOR="red"]invoke-virtual {p0, p1}, Landroid/view/MotionEvent;->modPointerId(I)I
          
          move-result v3[/COLOR]
          
          iget v0, p0, Landroid/view/MotionEvent;->mNativePtr:I
      
          const/4 v1, 0x0
      
          const/high16 v2, -0x8000
      
          invoke-static {v0, v1, [COLOR="red"]v3[/COLOR], v2}, Landroid/view/MotionEvent;->nativeGetAxisValue(IIII)F
      
          move-result v0
      
          return v0
      .end method
      
      ... ... ...
      
      .method public final getY(I)F
      [COLOR="red"]    .locals 4[/COLOR]
          .parameter "pointerIndex"
      
          .prologue
          .line 1989
          [COLOR="red"]invoke-virtual {p0, p1}, Landroid/view/MotionEvent;->modPointerId(I)I
          
          move-result v3[/COLOR]
      
          iget v0, p0, Landroid/view/MotionEvent;->mNativePtr:I
      
          const/4 v1, 0x1
      
          const/high16 v2, -0x8000
      
          invoke-static {v0, v1, [COLOR="red"]v3[/COLOR], v2}, Landroid/view/MotionEvent;->nativeGetAxisValue(IIII)F
      
          move-result v0
      
          return v0
      .end method
    • Now, you need to rename the method split to split2, and add this method:
      Code:
      .method public final split(I)Landroid/view/MotionEvent;
          .locals 2
          .parameter "idBits"
      
          .prologue
          move v1, p1
          invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
          
          move-result v0
          
          if-eqz v0, :cond_1
          
          const v0, 0x1
          
          shr-int/2addr v1, v0
          
          :cond_1
          invoke-virtual {p0, v1}, Landroid/view/MotionEvent;->split2(I)Landroid/view/MotionEvent;
          
          move-result-object v0
          
          return-object v0
      .end method

    IMPORTANT: If you're not using apktool or virtuous ten studio, the best is to decompile the jar and look to the smali changed to see how the code will looks like
    21
    We will try to describe any other problems with the games we found too. BUT, it's not means that the fix cause the problems. It'll be very appreciate if someone that read some non touchpad related problem here can confirm that happens without the fix too :p

    SOME GAMES HAVE LAGS WHEN USING THE TOUCHPAD WITH CM10. It's not a issue of the fix, it's a issue we identify on CM10. You can try FPSe without the fix and use the touchpads to see for yourself. The games we identify with this problem we'll say.

    TIP ABOUT GAME TESTING
    • if you tried any game optimized to xperia play using this fix and it works, please, tell us so we can update this list!
    • if you had some trouble with a xperia play optimized game, then, again, tell us so we can improve the fix
    • Finally, if you get FCs with some game when you tried, then send to us a logcat so we can look at the reason and search for a solution This is very important! This fix already brought a very improvement on the touchpad compability, but we is still working to improve it, and we need information and your help to it


    Games where the touchpad is working (maybe some game was already working, I can't tell :p):

    • 9mm (ICS) Works but very laggy
    • Amazing spiderman (ICS)
    • Asphalt 7 (ICS)
    • Asphalt 6 (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB
    • Backstab (ICS) (JB)
    • brothers in arms 2 free+ (ICS) Works with some bugs when you use two fingers on the touchpad NEED POINTER ID STARTING FROM 1
    • Call of Duty - Zombies (ICS)
    • Cyberlords - Arcology (ICS)
    • Dead on arrival (ICS)
    • Dead Space (ICS) (JB) Touchpad works on version 1.1.33. Actually the game works perfectly with this version on ICS. But the current version on the play store is 1.1.39, and we have reports that in this version the touchpad is not recognized.
    • Dead Trigger (ICS) (JB)
    • Desert winds (ICS)
    • Dungeon Defenders (ICS) NEED POINTER ID STARTING FROM 1
    • Eternity warriors (ICS)
    • Fifa 10 (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB. On ICS, I didn't feel any lag but the sound is cutting while we touch the left touchpad
    • Fifa 12 (ICS) (JB)
    • Fight heroes (ICS)
    • FPse (ICS) (already was working). You need to let the touchpad activation for the app
    • GraviTire 3D (ICS)
    • GTA III (JB) Touch is used for changing the radio. LAGS WHEN USING TOUCHPAD ON JB
    • GTA Vice city (JB) This game doesn't use the touchpads. LAGS WHEN TOUCH THE TOUCHPADS ON JB
    • Guerilla bob (JB)
    • Gun bros (ICS) Sometimes (when a message appear, I think) You need to release the touchpad and press again... but I think it's a game implementation problem
    • Lara croft and the guardian of light (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB
    • Max payne (ICS) (JB) Need the touchpad always activated (you can switch it with V0.6+)
    • Minecraft Pocket edition (ICS) (JB) FREE OF JB LAG (already was working)
    • Modern combat 3 (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB
    • Modern combat 4 (ICS)
    • Mupen64plus (ICS) (JB) (already was working)
    • Need For Speed Most Wanted (JB) This game don't user triggers or touchpads. Actually, Touchpad is used for scroll the map, but probably because some misimplementation
    • Nova 3 (ICS) (JB) You need V 1.0.2 to get this working with the XPlay because Gameloft took off the support to our device
    • Rises of Glory (ICS) (JB)
    • Samurai vegeance II (ICS)
    • Shadow gun (ICS) (JB)
    • Six Guns (ICS)
    • Sonic 4 Ep.2 (ICS) This game does not use touchpads, but the gamepad is recognized with the fix (probably with the STEP 1)
    • Start Batallion (ICS) Works with some bugs when you use two fingers on the touchpad NEED POINTER ID STARTING FROM 1
    • The Bard's Tale (ICS) (JB) FREE OF JB LAG Apparently this game have native implementation of the touchpad, what means that it don't need the fix to work
    • The Dark Knight Rises (ICS)
    • USB/BT Joystick Center 6 (ICS) With this app you can map touchscreen areas to the gamepad and touchpad, making a non optmized game can be played with the xperia play buttons. You can see how to config it here. The result is good in some games and bad in another.
    • Wild Blood (ICS)
    Games where the touchpad is not working
    • Galaxy on Fire II (ICS) (jb) FREE OF JB LAGTouchpad works and the screen button is gone, but the gamepad don't work. You need to push the area of the screen where the buttons mus be in if you want to play
    • Nova 2 (JB) touchpad non working + graphical bug at the menu ( not in the game) NEED A NEW TEST FOR V 0.3
    • OnLive (ICS) Last report: touchpad working gamepad don't. I'm waiting for more details (more details about how to get more details here)
    • Pewpew (ICS) -The touchpad of this game doesn't work well in the ICS, even without the fix, the touchpad is detected but it's messed up. You can use the cross to move and the buttons to shot. Each button shot in one direction, so, it's like a second cross in the gamepad.
    • THE KING OF FIGHTERS Android (ICS) This game doesn't use the touchpad, just the gamepad, but the gamepads isn't treated well on ICS... WORKD WELL ON MIUI AUSTRALIA. INVESTIGATING WHY
    16
    Cm9 is my daily driver right now, so I updated touchpad fix for fxp216.
    Zip contains framework.jar, touchpad activator & build.prop.
    13
    Build.prop fix

    Guys!

    Here I'll list all the fixes need to the device be recognized as a Xperia Play.

    Here is a lot of properties of the GB Stock build.prop, what is in red is the ones importants to recognition! If we discover that some other need changes too, I'll update it here!

    If you're using other xplay than the R800i, just change the 'R800i's for your variant, like 'R800x', for example

    FOR THE MOD, JUST LOCATE AND CHANGE THE PROPERTIES IN RED FOR THE VALUE PROVIDED HERE!!! IF YOU WANT TO EXPERIMENTER CHANGING OTHER PROPERTIES, DO IT FOR YOU OWN

    THE PROPERTY mod.touchpad.startfrom IS NOT PRESENT IN THE ORIGINAL BUILD.PROP, IT'S A CUSTOM PROPERTY. IF YOU CAN'T LOCATE IT IN YOUR BUILD.PROP, JUST INCLUDE IT IN SOMEWHERE

    Any other property you don't have and is in red, add it

    Code:
    ro.board.platform=msm7x30
    ro.build.characteristics=default
    ro.build.version.release=4.0.4
    ro.build.version.codename=REL
    ro.build.version.incremental=UL5_3w
    ro.build.display.id=4.0.2.A.0.42
    ro.build.id=4.0.2.A.0.42
    ro.build.fingerprint=SEMC/R800i_0000-0000/R800i:2.3.4/4.0.2.A.0.42/1f_v3w:user/release-keys
    ro.build.date=Tue Apr 24 11:57:09 2012
    ro.build.tags=release-keys
    ro.build.description=R800i-user 2.3.4 4.0.2.A.0.42 1f_v3w test-keys
    [COLOR="Red"]ro.build.product=R800i[/COLOR]
    ro.build.host=BuildHost
    ro.build.user=BuildUser
    ro.build.date.utc=1335261429
    ro.build.tags=test-keys
    ro.build.type=user
    ro.product.cpu.abi2=armeabi
    [COLOR="red"]ro.product.model=R800i
    ro.product.board=
    ro.product.manufacturer=Sony Ericsson
    ro.product.brand=SEMC
    ro.product.device=R800i[/COLOR]
    ro.product.cpu.abi=armeabi-v7a
    [COLOR="red"]ro.product.name=R800i_0000-0000[/COLOR]
    ro.product-res-path=framework/SemcGenericUxpRes.apk
    ro.wifi.channels=
    [COLOR="red"]mod.touchpad.startfrom1=1[/COLOR]
    
    ro.semc.version.cust=1253-3429
    ro.semc.version.fs_revision=4.1.B.0.431
    [COLOR="Red"]ro.semc.product.model=R800i[/COLOR]
    ro.semc.ms_type_id=AAD-3880119-BV
    ro.semc.version.cust_revision=R1I
    ro.semc.content.number=PA5
    [COLOR="red"]ro.semc.product.name=Xperia Play
    ro.semc.product.device=R800[/COLOR]
    ro.semc.batt.test.min_level=70
    ro.semc.version.fs=WORLD-i
    ro.semc.rem-roam-icon=1
    ro.semc.xloud.supported=true
    ro.semc.batt.test.z_threshold=50
    ro.semc.batt.capacity=1500
    ro.semc.sols.company-code=5
    ro.semc.sols.product-code=87
    ro.semc.timescape_keys=Sony_Ericsson_Xperia_PLAY
    ro.semc.dashboard.xperiaplay=true
    ro.semc.wifi.hostapd=1
    ro.semc.dashboard.searchuri=http://pss.dl.playstation.net/pss/content/list.html