yashsingh1/xdaforums huggingface dataset:
[Xperia Play Android Development] Lordomn:
[MENTION=5527935]Niko of Death[/MENTION] I will be fixing the touchpads on that ROM and my other ROM (Xperia Z Jellybean)

I finally got my laptop... in the process of getting it setup. I can get back to editing the ROMs smali files.
[Xperia Play Android Development] darkharbinger81:
Some of the touchpads are also kernel releated, as in cm7 the touchpads worked on minecraft but on my latest miui port(CosmicUi from Cosmic Dan<---Personal Port) on 2.3.7 cm7 based they dont work (darkforest miui kernel) but the fxp kernel for cm7 touchpads worked but in the grand theft auto games nothing works touchpads or gamepads
[Xperia Play Android Development] Lordomn:
I'm adding the touchpad fix to my roms. But it keeps causing a bootloop. I followed your guide and it builds but I'm not quite sure why it's doing that. Any ideas would be appreciated. Thx.
[Xperia Play Android Development] farenheith:
Hi,

Please, try to get a logcat from the booting so we can know what's wrong. You can do this using adb, I'm sure you'll find a howto somewhere in the forum
[Xperia Play Android Development] Lordomn:
Yeah I will do that if the jar file I try it on doesn't work. I know how to logcat ;) :p. I will get one after I try it out. One question tho....

[MENTION=3914809]farenheith[/MENTION] On the dispatchGenericMotionEvent where you say to add the goto from the method of the code.... You do mean the goto before the .end method of the same method I am inserting lines in red...
[Xperia Play Android Development] farenheith:
I mean the last goto of the method. The problem is that on each decompilation the name of the labels can vary, so, this line in particular must be edited to point the goto you got on each time you do it.
[Xperia Play Android Development] RoboticBuddy:
Is there any way to use the "Always Activated" setting on Stock-based ICS roms? It doesn't seem to be working for me...
[Xperia Play Android Development] farenheith:
I did once a version for marks roms... I don't know if it's still working though...
[Xperia Play Android Development] Lordomn:
[MENTION=3914809]farenheith[/MENTION] OK so I got the ROM to load but the touchpads still don't work. I was wondering if you could look at the jar for me. Just let me know where I went wrong. Not sure what i missed. Because games that did recognise them don't work now, like minecraft, EvacHD. I'm sorry to bother you.

This is the link for it as I can't add attachments for some odd reason.

https://www.dropbox.com/s/2fobnf9t3enm8np/framework.jar
[Xperia Play Android Development] farenheith:
Please send me just the edited smali files before and after the modification. It'll be easier to figure out what is wrong
[Xperia Play Android Development] Lordomn:
OK. I'm trying to examine your fix for cm10 to see if I can spot what I could have missed
[Xperia Play Android Development] Lordomn:
[MENTION=3914809]farenheith[/MENTION] here are the files. I put them in separate folders. Thx a lot.

https://www.dropbox.com/s/aqpehwywjucw3oe/SMALI FILES.zip
[Xperia Play Android Development] senadin001:
I have no lag at all in game "9mm" , on first page i reed that it is laggy on ICS, but it's so smooth on mine xplay(ICS)
[Xperia Play Android Development] julian280:
Hi Farengeith, we are finally getting KitKat on our Xperia Play. It boots and is fairly stable despite some bugs on wifi and other things, and it would be awesome to have touchpads working on it cause games run awesome, even better than they did Gingerbread!!!!

Could you please help us by making a version for KitKat? it's on this thread

{Play/Neo L}[DEV][WIP][KitKat 4.4.4][CM11.0] LegacyXperia

Thanks in advance!!! :fingers-crossed:
[Xperia Play Android Development] farenheith:
Hello!

That's pretty good news!

Unfortunately I don't have a Xperia Play anymore, but I'll have a look on the new source code so I can figure out if my mod can be applied to it. I want to apologize to the ones that tried to talk to me until now and I didn't answer, but I promise that I'll try to make this last contribution for this device.

Tonight I'll take a look on it, I promise, but after that, would be nice if someone that still have a Xperia play take on this fix for now on.

Edit: Actually I already took a look on the code. At least the java implementation of the touchpad fix looks like very possible.

All the sources I need to look was here

I don't know if it's possible, but if the responsibles of this code could implement the fix directly on the source code, would make things easier, but of course is possible to apply the fix on the decompiling the framework, though I think, maybe, we can have some problems with ART runtime :/
[Xperia Play Android Development] julian280:
Thanks a lot!!! Its amazing to hear you're helping us again :)

The CM11 dev is [MENTION=3839575]mikeioannina[/MENTION] said that he already modded the framework.jar and we only need to install the TouchpadActivator.apk

I will test it tonight. If it doesnt work maybe you can work together to make the touchpads work :)

And I can be a tester of you agree ;)
[Xperia Play Android Development] farenheith:
I see. Then he made the change trough decompiling. Of course you can be a tester, as long you still have a Xperia Play. Talk to the dev later, ask him to consider to implement the java fix. It will make the work easier in the future, as no framework.jar must be modded after the ROM compilation. I'm almost sure the code will not affect another devices, but has been a while that I made it, so I can't confirm for sure.

But there's one thing about the touchpad activator that can be bad news: at least with jellybean, almost every game did not needed the activator. If you can't use the touchpad now without it, then you have a chance that will not work even using it. Try with Lara Croft and the guardian of Light, or FPSe. This ones are good for primary tests
[Xperia Play Android Development] mikeioannina:
Hi,

The changes are made directly in the sources with this commit: http://review.cyanogenmod.org/#/c/63422

I don't have that much experience with zeus and didn't have time to test any games, but people report that the touchpads are not working, although the kernel driver seems to load properly
[Xperia Play Android Development] farenheith:
I see...

I remember there was an app from Sony to test the touchpads and was implemented via JNI. This app always worked even without any fix.. As I don't have a Xperia play anymore, someone must take a look on it, but I'm almost sure that the app was this one, would be nice if someone can try it. Also this was the first game I could made work with the touchpads, the first version on the fix was made based on the decompiled sources of that app.

If I'm not mistaken, the touchpad support for Lara Croft depends entirely on the existence of the ViewRoot interface and the implementation of setProcessPositionEvents.

Finally, when the touchpad support was first implemented on FPSE (for android 4+), I give the tips for the dev to call the same method, so, both apps shoud work.

If any of this work, then probably the fix is just not compatible anymore with 4.4

If you see the changes on View.java, you will notice that the trick was just call the dispatchTouchEvent instead of following the lines of dispatchGenericMotionEvent. Well, I was look into the dispatchTouchEvent code and looks like the event can be neglected if it's not valid or unsecure.

public boolean dispatchTouchEvent(MotionEvent event) {
if (mInputEventConsistencyVerifier != null) {
mInputEventConsistencyVerifier.onTouchEvent(event, 0);
}

if (onFilterTouchEventForSecurity(event)) {
//noinspection SimplifiableIfStatement
ListenerInfo li = mListenerInfo;
if (li != null && li.mOnTouchListener != null && (mViewFlags & ENABLED_MASK) == ENABLED
&& li.mOnTouchListener.onTouch(this, event)) {
return true;
}

if (onTouchEvent(event)) {
return true;
}
}

if (mInputEventConsistencyVerifier != null) {
mInputEventConsistencyVerifier.onUnhandledEvent(event, 0);
}
return false;
}

So, maybe the fix must be reviewed to make it work.

The reason to call the touchevent is that, on android 2.3, there are no GenericMotionEvent, so Sony did a workaround and made the touchpads dispatch a touchevent and the game devs should look the difference between both. But from android 4.0 to 4.4, many things could be changed.

I wish I could help more but without the device there's not much I can do, unless tell all the effort I made in the past :(
[Xperia Play Android Development] twistedumbrella:
Moved to a new thread. See below.
[Xperia Play Android Development] farenheith:
I see your point but in gingerbread many apps treated the touchpads without using any NativeActivity, such as Lara's game. What broke the support for the game in the ICS and later was the fact that the touchpads no longer was dispatching a TouchEvent, instead, it was doing it with a GenericMotionEvent.

Also, this behavior was not enabled by default, the app should call the setProcessPositionEvent method to activate it, that's why the mod made many games recognize the touchpad again. This is, in fact, a customization of the framework made by Sony in the Gingerbread. But the fix was not necessary in the Beta ICS and ROMs based on it, just on AOSP based ones, because Sony let the behavior compatible in the beta release.

But apps that implements the touchpad via NativeActivity doesn't need any fix, in fact, like Mupen64, for example.
[Xperia Play Android Development] farenheith:
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!
[Xperia Play Android Development] twistedumbrella:
Rather than continue attempting to explain why old methods don't work, I started a new thread for alternatives that are still working:

http://xdaforums.com/showthread.php?t=2871566
[Xperia Play Android Development] farenheith:
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.
[Xperia Play Android Development] twistedumbrella:
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... ???
[Xperia Play Android Development] farenheith:
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: [MENTION=4766880]julian280[/MENTION], did you test anything? I was assuming it was not working but maybe I just didn't get what you said before.
[Xperia Play Android Development] twistedumbrella:
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.
[Xperia Play Android Development] farenheith:
[MENTION=4766880]julian280[/MENTION], 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.
[Xperia Play Android Development] julian280:
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
[Xperia Play Android Development] farenheith:
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.
[Xperia Play Android Development] diejuse:
touchpad in CM13 or LineageOs 14.1?
[Xperia Play Android Development] farenheith:
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 :)
[Xperia Play Android Development] farenheith:
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

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
[Xperia Play Android Development] otonieru:
how about the circle button problem ?
[Xperia Play Android Development] farenheith:
I do believe the right changes on the build.prop will solve the circle button problem once for all. Also, some games will start to recognize the touchpads on CM9, but not every game, that's why we need to change the framework.jar.

here you can look a explanation about the build.prop changes
[Xperia Play Android Development] gopin:
alright u convinved me to try cm9 one more time.:D

only game i care about (fifa12) and (rise of glory) do not even start, unless i swap buildprop with mt25i which is neo L. then it works but with screen controls. using ur suggested changes in previous post R800i it just wont start. :(

touchpad in shadowgun worked without using ur modded framework.jar :cowboy:

i'll keep testing and reporting.
[Xperia Play Android Development] farenheith:
Thanks. Some games I really didn't know if works before the fix :P. But let me ask you something, what changes you did on the build.prop?
[Xperia Play Android Development] CosmicDan:
Yeah thats interesting, could you share a link to this Neo L ROM?

Sent from Xperia Play (R800a) with Tapatalk
[Xperia Play Android Development] farenheith:
I just tried the rise of glory on the CM10, and it's working, but the touchpad is not recognizing :(
[Xperia Play Android Development] gopin:
rise of glory worked after changing framework.jar with yours, but like u say no touch pad. fifa12 was starting, checking lisence, checking updates and then just closing to home, but after changing to ur framework.jar it causes fc.

i totally swapped the build prop. im using the one in this post http://xdaforums.com/showthread.php?t=1762372 by vokal1992 neo L fw for the play. the file (Xperia play enabler.zip) has a modded build.prop.

if u use it u need to change the line

wifi.interface=eth0

to

wifi.interface=wlan0

or wifi will not work, i dont know what else it breaks. so far everything works.
[Xperia Play Android Development] farenheith:
Okay, I'll try to analyze the games rises and glory, to know how it's trying to access the touchpad. About the Fifa 2012, can you send a logcat so I can try to find why the FC happened?
[Xperia Play Android Development] gopin:
rises and glory was fc before using ur file. FYI

how do i get logcat? :silly: never done it.

if it matters, the version of fifa12 i'm using is 1.3.96

Edit: nvm just gimme a sec
[Xperia Play Android Development] farenheith:
You can use the adb...

I put it attached if you don't have... if you are on windows, you need to open the DOS prompt as an administrator and do this commands:

cd {folder of the adb}

adb shell

logcat > /sdcard/logcat.txt

Wait a little while (20 secs, maybe is enough)

Press Ctrl+C

adb pull /sdcard/logcat.txt logcat.txt

This last command will copy the logcat from you sdcard to the current folder. Then you send it to me :P.

I tried some other ways but Idk why it doesn't work. This is the only I can get logcat
[Xperia Play Android Development] gopin:
pax recommended catlog. it is free in the market and it is really easy to use.

see previous post. already posted it.

tried crlearing data but nothing still.

i noticed that u list shadowgun as not working for cm10 in op.

in my experience, for that game in particular u need to delete data in sd card and re-download again when changing rom.or else it lets u go thru all menus, but exits to home right before starting actual game.

alright!

going to bed
[Xperia Play Android Development] farenheith:
I did analyzed the Rise of glory. It's easier to see as it's running and I have a free version to download :P.

I think I already get why the touchpad is not working already. I'll try to fix it too and see what we get

Edit: Okay guys, I did the touchpad work with the Rise of glory. Maybe (MAYBE) it'll work with all games now, but It's very important that we tests, because now the touchpad returns is ALWAYS ACTIVATED. I'll explain:

I figure out, with the Lara croft game that the Sony frameworks have a "trigger" to activate the return of the touchpad. BUT the method that the Lara was using to activate the touchpad is not been using by the Rise of glory, and I still can't figure out what it's doing to activate this return. So, I did the touchpad be always activated and some other changes that I'll organize and post later. So, I don't know if it can cause some unexpected behavior.

here you can download the new fix. I already tested it with Rise of glory. Don't forget to do the last described changes on the build.prop, you can see this on the OP
[Xperia Play Android Development] gopin:
Rise of glory is now working. Nice!

Fifa12 no longer fc, but it does exit to menu after checking for license and updates. Ill try re-downloading sd card data.

Good job!
[Xperia Play Android Development] farenheith:
Thanks

Actually, I did not change anything for Fifa 12. The logcat you sended before is useful, There are the ocurring error, but I couldn't found the cause yet :(. If re-download the data works, tell us :).
[Xperia Play Android Development] farenheith:
OP updated with the version 0.3!

In this version, I know the touchpad is working for rise of glory and GTA III (but GTA is only playable in CM10, as in the ICS after a few seconds the game freeze the phone. While I tested it on the JB, nothing like this happened to me), and for the previous compatible games too.

Gopin reported a freeze on the Fifa 12, but as the game is shareware, I'm unable to test it right now and analyze the cause is a little hard :(, but I'll try to figure out this as soon as I can

Also, if anyone can test Shadow gun on the CM10 will be very helpful. I'm having FCs on CM10, but not in CM9. The problem is that my data is a little messed up, and I can't format it because of a app that I need and is "unbackupable"
[Xperia Play Android Development] abrahamt24:
comfirmed working for Sonic 4 Ep.2 on CM9 FXP-138

i'll test more games and report here
[Xperia Play Android Development] farenheith:
Thanks for the info!

But this have a 2d game play, isn't it? The touchpad can be used on it?
[Xperia Play Android Development] abrahamt24:
no, the game doesn't use touchpad

but before i use your mod, the buttons doesn't work and now it works

N.O.V.A 3 also working with no lags when i touch the touchpad