yashsingh1/xdaforums huggingface dataset:
[Xperia Play Android Development] farenheith:
I see... But it's look like a problem that is solved with the first step of the mod. I understand how the game can use the second step to recognize the Xperia play, but it's very unlikely
[Xperia Play Android Development] abrahamt24:
i've just noticed this, if we change the build.prop to GB version, play store will treat our device like GB. so, for some games that doesn't compatible for GB such as Blood & Glory wouldn't shown there isn't it.?
[Xperia Play Android Development] CosmicDan:
Not sure I understand you, but Blood and Glory already worked on ICS before with thread. Also with full touchpads.
[Xperia Play Android Development] gopin:
re-downloading data for fifa didn't help, but here is a logcat. it shows different info than the one i sent before. i think its trying to resize the touch area? btw, this game used to work on marks and xdark rom
[Xperia Play Android Development] CosmicDan:
You forgot to attach logcat :)

Well those two ROM's are stock-based, so it's probably a CM9 issue. If you're interested, I will be releasing MIUI based on Stock ICS (Neo L 4.0.4) that aims to be 100% working latest MIUI for our device (I will also be including this great touchpad fix).
[Xperia Play Android Development] farenheith:
Let me tell you, sometime ago something like this happened with Lara croft game. just changing the build.prop to looks like a GB I could download the game, but Square already fix it. Now I can't download the Blood & glory, Idk why, but I edited the build.prop in the same way and still I couldn't, so...

If you'll try something like that, be careful with the version sdk. If you edit this to 10 (GB value) and reboot your phone, you'll get bootloops

Edit: No bootloops only... I forgot to say xD. You'll lost all your data too
[Xperia Play Android Development] farenheith:
Well, the touchpad resizing occurs when the orientation of the phone is changed (you move the slider, for example).

But there's some errors I'll take a look more carefully :). Thanks

Edit: Btw. Fifa, just FC after apply the fix, or it's doing it either before?
[Xperia Play Android Development] gopin:
no, after applying fix v3 fifa does not fc. it just exits after checking license and updates.

Logcat uploaded :beer:
[Xperia Play Android Development] farenheith:
Yeah, but are you sure this behavior is just after the fix? I mean, when you have the original CM framework.jar nothing like this happens?
[Xperia Play Android Development] CosmicDan:
Yeah if it doesn't work on CM9/CM10 originally, there is not much that can be done about it. Wait for "Turbo MIUI classic" (24-48 hours) it's based on stock ICS and will have this touchpad fix ;)
[Xperia Play Android Development] gopin:
this is normal behavior with original framework and with v3.

With v2 it fc and changing the build.prop from r800 to mt25 makes it work, but no touch or game pad only screen buttons.
[Xperia Play Android Development] farenheith:
This is when the game screw up :/.

The game is like freezing I think and then the system kill it. It'll very difficulty to solve this error, because we don't have how to get more info from the log :(.

Well, maybe I find more info on the log, but I can't promise I'll solve this problem, because it can be related with something more deeply on CM
[Xperia Play Android Development] CosmicDan:
farenheith, I thought the v0.3 changes to View.smali looked a bit strange (in post #2).... so I compared with your precompiled CM9 and updated my dispatchGenericMotionEventInternal method from there. It's different, I think post #2 changes will break compilation :)

Here's hoping it works in Asphalt 6 on MIUI now, will let you know....
[Xperia Play Android Development] farenheith:
That's strange...

The code there is looking the same with my source code :/.

Maybe the decompiled source can be a little bit different.

what did you see different?
[Xperia Play Android Development] CosmicDan:
Well the first line was still locals (in CM9) and not registers (in post #2). I know the labels can change, but it looks funny in post #2. Here is the patch file I used, for the new MIUI ROM. BTW, touchpads work perfect in Asphalt 6 now - great work friend :D But I think D-Pad is easier in racing games lol... still, it works! So all Gameloft games should.

--- smali/android/view/View.smali Tue Jan 20 09:26:36 1970
+++ smali/android/view/View.smali Tue Jan 20 09:26:36 1970
@@ -3681,64 +3681,83 @@
.line 5674
iget-object v0, p0, Landroid/view/View;->mListenerInfo:Landroid/view/View$ListenerInfo;

.line 5675
.local v0, li:Landroid/view/View$ListenerInfo;
- if-eqz v0, :cond_1
+ if-eqz v0, :cond_2

#getter for: Landroid/view/View$ListenerInfo;->mOnGenericMotionListener:Landroid/view/View$OnGenericMotionListener;
invoke-static {v0}, Landroid/view/View$ListenerInfo;->access$400(Landroid/view/View$ListenerInfo;)Landroid/view/View$OnGenericMotionListener;

move-result-object v3

- if-eqz v3, :cond_1
+ if-eqz v3, :cond_2

iget v3, p0, Landroid/view/View;->mViewFlags:I

and-int/lit8 v3, v3, 0x20

- if-nez v3, :cond_1
+ if-nez v3, :cond_2

#getter for: Landroid/view/View$ListenerInfo;->mOnGenericMotionListener:Landroid/view/View$OnGenericMotionListener;
invoke-static {v0}, Landroid/view/View$ListenerInfo;->access$400(Landroid/view/View$ListenerInfo;)Landroid/view/View$OnGenericMotionListener;

move-result-object v3

invoke-interface {v3, p0, p1}, Landroid/view/View$OnGenericMotionListener;->onGenericMotion(Landroid/view/View;Landroid/view/MotionEvent;)Z

move-result v3

- if-eqz v3, :cond_1
+ if-eqz v3, :cond_2

.line 5688
:cond_0
:goto_0
- return v1
+ goto :goto_2

.line 5681
:cond_1
+ :goto_1
+ return v1
+
+ :cond_2
invoke-virtual {p0, p1}, Landroid/view/View;->onGenericMotionEvent(Landroid/view/MotionEvent;)Z

move-result v3

if-nez v3, :cond_0

.line 5685
iget-object v1, p0, Landroid/view/View;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;

- if-eqz v1, :cond_2
+ if-eqz v1, :cond_3

.line 5686
iget-object v1, p0, Landroid/view/View;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;

invoke-virtual {v1, p1, v2}, Landroid/view/InputEventConsistencyVerifier;->onUnhandledEvent(Landroid/view/InputEvent;I)V

- :cond_2
+ :cond_3
move v1, v2

.line 5688
goto :goto_0
+
+ :goto_2
+ invoke-virtual {p1}, Landroid/view/MotionEvent;->getSource()I
+
+ move-result v2
+
+ sget v3, Landroid/view/InputDevice;->SOURCE_TOUCHPAD:I
+
+ if-ne v2, v3, :cond_1
+
+ invoke-virtual {p0, p1}, Landroid/view/View;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z
+
+ move-result v2
+
+ goto :goto_1
.end method

.method private findViewInsideOutShouldExist(Landroid/view/View;I)Landroid/view/View;
.locals 4
.parameter "root"
[Xperia Play Android Development] farenheith:
I see... Did you use apktool or Virtuous Ten Studio, didn't you?

Yeah, I didn't said nothing about the register, but there's a difference when you use one of theses tools on the generated code. When you use the baksmali, in place or .local, you see .registers (the sum of the virtual parameter for non static methods, i. e., the object owner of the method itself, the parameters and the variables used) and the labels is unique on the entire file.

I think the code is easier to manipulate when decompiled with apktool or Virtuous Tem Studio, but I was maintaining the code generate for the baksmali for a while, as it's the first tool I used :P.

But I think I'll change the additional information for something like... if you're not using baksmali the best is to you decompile the jar itself and take a look on these methods, I think is easier than review the labels and stuff :P
[Xperia Play Android Development] CosmicDan:
I'm using APKTool 1.5.0.

Yeah, well... no big deal really, it's all working here. Those people who are interested in the second post for the smali changes would already be skilled enough to decompile your frameworks and examine them :P

MIUI will be out soon, everything on it is perfect... just working on the kernel now. BTW, new MIUI ROM+kernel has 684.5M on /data :D
[Xperia Play Android Development] farenheith:
Wow, 684 mb is a like magic :eek:.

Btw, I really believe this last change will offer full touchpad support for all games, because all the genericmotionevents is now forwarding the event to ontouchevent, always, so, the only problems we'll find now, I think, are specific game problems, like the one with Fifa 12 :/

It's a little frustrating, because this is really hard to solve, and Idk where to start...
[Xperia Play Android Development] CosmicDan:
New MIUI is ready ;)

I would like to know if GTA3 and FIFA are playable on it!
[Xperia Play Android Development] NeWCuLTKiNG:
Would this be possible on cm7? gaming on cm7 is by far the best gaming experience for our play.
[Xperia Play Android Development] farenheith:
Sure, it is...

But is very difficult I think... The question is: the ICS (AOSP ICS) offers a implemented way to get the touchpad return. I just use this way and forwarded the events to the "Sony way". But, there's no such a thing in AOSP CM7, or at least I don't know. Also there's some big differences between the event treatment on ICS and GB

So, the big problem is do the framework capture the touchpad events for itself. I think in AOSP it's just possible to do this via JNI
[Xperia Play Android Development] NeWCuLTKiNG:
Thanks for the reply. Wish i could help but sadly I can't. Hope one day it will be figured out before my play has its final day
[Xperia Play Android Development] wuby:
I would test many games, when someone should send me Play gift card, i could buy some games from it and try them :)

Btw: Asphalt 7 on some roms works, some not...

(I bought Asphalt 7 thru sms, dont complain about warez)
[Xperia Play Android Development] farenheith:
hahahaah... I think it's very unlikely xD. The idea is the people test the games that they already own, or the free ones.

Edit: But, about the Asphault 7... did you test it on CM9 using this fix?
[Xperia Play Android Development] farenheith:
Touchpad fix v 0.4

Guys,

I can't test the Fifa game as I don't have it, but I think I figure out a probably reason for the problem.

If anyone can test it for me will be very good! (REMOVED LINK!! LOOK EDIT2)

Edit: I found a game where the problem that I THINK it's happening on the Fifa 12 is happening too! The Need for speed hot pursuit AND I BOUGHT IT a long time ago xD!! YAY! I'll work on it

Edit2: TOUCHPAD WORKS ON HOT PURSUIT!!! The error on this games was: just after the update verification, FC. Very the same as Fifa. With the fix v0.4, no error and touchpad support!

Please, someone download it and test with Fifa: here
[Xperia Play Android Development] benben972:
On CM9 or 10 ?
[Xperia Play Android Development] farenheith:
True xD I forgot to said.

It's for CM9, but I can make a CM10 fix too
[Xperia Play Android Development] cj360:
I'll actually start on merging this to aokp now :p that I don't have homework due tmr.
[Xperia Play Android Development] farenheith:
Nice. Use the V 0.4 because I think it's stable... I just want to someone test it on Fifa 12 to do a "official" release xD
[Xperia Play Android Development] CosmicDan:
I guess I will make a patch for MIUI so the other guy asking (can't remember his name) can test, but he might have already gone back to another ROM.
[Xperia Play Android Development] farenheith:
You need to know what I change... I'll say it here for now:

ViewRoot.smali:

2º line: .super Landroid/os/Handler;

constructor:

.method public constructor <init>()V
.registers 1

.prologue
.line 11
[COLOR="Red"]invoke-direct {p0}, Landroid/os/Handler;-><init>()V[/COLOR]

return-void
.end method

method setProcessPositionEvents

[COLOR="red"].method public setProcessPositionEvents(Z)V[/COLOR]
.registers 3
.parameter "b"

.prologue
const/4 v1, 0x1

.line 15
if-eqz p0, :cond_6

.line 16
sput v1, Landroid/view/ViewRoot;->BIND_TOUCHPAD_ONTOUCH:I

.line 19
:goto_5
[COLOR="Red"]return-void[/COLOR]

.line 18
:cond_6
const/4 v0, 0x0

sput v0, Landroid/view/ViewRoot;->BIND_TOUCHPAD_ONTOUCH:I

goto :goto_5
.end method

class ViewRootImpl.smali

2º line: .super Landroid/view/ViewRoot;

constructor:

.method public constructor <init>(Landroid/content/Context;)V
.registers 11
.parameter "context"

.prologue
const-wide/16 v7, -0x1

const/4 v6, 0x1

const/4 v1, 0x0

const/4 v5, -0x1

const/4 v4, 0x0

.line 329
[COLOR="red"]invoke-direct {p0}, Landroid/view/ViewRoot;-><init>()V[/COLOR]

.line 142
... ... etc ... etc ... etc...

I think this is it...
[Xperia Play Android Development] gopin:
I'm still here, loving ur miui!

I'll gladly test fifa12 when u port this fix to that rom.

also I noticed that shadow gun on miui works, but only using ram swapper from the market. I thought that changing settings made it work (as reported in miui thread), but it really is a matter of ram (I think).

in this thread they talk about a free way of getting ram swapped to SD. I don't know if it is compared to the app in the market (which is about us $8)

http://xdaforums.com/showthread.php?t=1821071
[Xperia Play Android Development] CosmicDan:
You didn't need to do all that :) What is the new framework.jar test based on? CM9-FXP139? I can compare manually.
[Xperia Play Android Development] farenheith:
CM9 :P

But this is the differences between the v 0.3 and v 0.4
[Xperia Play Android Development] CosmicDan:
OK great, that is good to know. Yes, the Swapper app is just a GUI to do built-in functions of making swap space. This is annoying now because swap is very slow compared to RAM, I will try to find a solution.

EDIT: What swap size/settings did you use?

OK, but is it FXP139? :P I just want to make sure.
[Xperia Play Android Development] gopin:
yeah swapper does slow down the phone (especially on my crappy sdcard lol) I only turn it on for gaming and it's not bad.

edit: 512mb
[Xperia Play Android Development] farenheith:
This is still FXP 138.

But I don't believe they make changes on the framework... I think it's very unlikely to do this, or am I wrong?
[Xperia Play Android Development] CosmicDan:
Yeah, hmm.... maybe if you set a very low swappiness value it will retain performance. i.e. this code from command line:

sysctl -w vm.swappiness=60

...means that the system is 60% likely to swap old-memory out. But there are other VM values I will try to experiment with.

Anyway, if you want to talk more on this we can do so in the MIUI thread :) normal-users not interested in helping the project will probably complain again but stuff them lol.

Yes true it's rare, but sometimes they do. Better safe than sorry :P
[Xperia Play Android Development] benben972:
I can't test Fifa 12 but Six Guns work with very small lag !
[Xperia Play Android Development] farenheith:
Nice! Did you tested with CM9 using the v0.4 fix?
[Xperia Play Android Development] benben972:
Yes with 0.4 fix ! For dead space no change and Galaxy On Fire 2 gamepad doesn't work but buttons on screen disappear... Strange...
[Xperia Play Android Development] farenheith:
Yeah, galaxy on fire the touchpad works, but the gamepad don't.. idk why xD

I'll change the info on the post #2 about this game to not working and I'll try to figure out this problem later...
[Xperia Play Android Development] cj360:
Here's a version for aokp ICS. I'm not sure how usable the GSM aokp JB is but I'll make one for JB aokp if /once there's cdma data for it.

Download via mediafire

Tested on Asphalt 7 works great. I'll be testing on others when I can but other people that use aokp ICS can test it out. ;)
[Xperia Play Android Development] farenheith:
Verion 0.4

OP and dev instructions Updated!

The version 0.4 is tested in a few games and I think it's stable enough:

Lara Croft game

Six guns

Need for speed hot pursuit

Asphalt 7

Galaxy on fire 2 (same problem of before :()

Also, I put the AOKP-ICS version on the OP, thanks to cj360!

Any tester is very welcome!
[Xperia Play Android Development] ~iSamur@i:
Ok, so when I return from the university Saturday I know what I can do ;)
[Xperia Play Android Development] benben972:
Fix work for Mx player and Galery LOL amezing !!

All gameloft game fix (asphalt 6&7 and six Guns) ?
[Xperia Play Android Development] gopin:
on v3, touchpad did not work for crash bandicoot (the one that comes with stock fw) using controller type 5 I think. (whichever uses touchpad) I checked the XML files and the value is true, but in the game's menu the option for analog was greyed out and unchecked.
[Xperia Play Android Development] farenheith:
Hhahaah... I think the mx player and galery is side effects of the fix. The touchpad is always enabled until I figure out some problems I found.

And the touchpad is working with all the gameloft titles we have tested so far, also with hot pursuit (Eletronic Arts) with the V 0.4 and Gun bros (Glu mobile). It's very promising.

As far as I remember, crash bandicoot don't have touchpad support. When I was on stock, if my mind is not confusing facts, this option for crash bandcoot was greyed too.
[Xperia Play Android Development] benben972:
I'm not sûre but...batery drain fast :eek:

Back to 0.3 for test
[Xperia Play Android Development] farenheith:
If you are on FXP139, then maybe this is the reason.

The changes on this fix doesn't affect battery life, because it's not include any listener or process in the system. The listener to the touchpad is always there on ICS even without the fix.
[Xperia Play Android Development] gopin:
well, I do remember ;)

when enabled, both cross and touchpad allowed you to move the little guy around. its not a problem.

I'm just saying maybe looking at how that game sees touchpad could help improve your work. :beer:
[Xperia Play Android Development] benben972:
I'm on FXP138 :confused:
[Xperia Play Android Development] farenheith:
Mmmm.... are you sure? In this case I need to do some tests :/.

I'll reinstall the crash bandicoot and see what I got with V 0.4, and maybe other psxperia game with touchpad support
[Xperia Play Android Development] cj360:
On stock r800x the touch pads were not used in crash bandicoot. Them and the shoulder buttons didn't do anything.

Sent from my Xperia Play
[Xperia Play Android Development] farenheith:
Well.. In this case is not the FXP139 :P.

But I'm pretty sure that is not the fix, because in most usage time the codes we modified is not executed and the touchpad is always been tracked by the system, even without the fix, the only difference is, with the fix, the touchevent is triggered
[Xperia Play Android Development] gopin:
can't say about shoulder btn, but I remember playing crash with touch pads. it was silly cause u could use either cross or analog. like fpse I guess.
[Xperia Play Android Development] ~iSamur@i:
hey farenheith, fifa 12 is in sale at 0,25 €, so if you want to work on it maybe is better to buy it now
[Xperia Play Android Development] farenheith:
I know xD.

Is a little shameful, but I'm looking for a job right now and I'm really cutting unneeded expenses, even if is just a miserable value xD.
[Xperia Play Android Development] farenheith:
Guys!

OP and dev instructions Updated!

The fix V0.3 and V0.4 broke the FPSe touchapd support. I realize the reason: the touchpad events was always forwading to the ontouchevent. This, in some way, broke the touchpad support.

So, the fix v0.5 I change it. Now, the touchpad will not be recognized to arbitrary apps, like gallery and google now, but will not break the FPSe.

I tested it with the following apps:

FPSe

Lara croft game

Need for speed hot pursuit

Rise of glory

This apps is like a checkpoint to me, because each change on the fix I made to make one of these apps works properly.

As always, testers are very welcome!
[Xperia Play Android Development] cj360:
I think next I wanna try this on cm7. Sure it's old but GTA III is crap on ics for us. Maybe 1.4 isn't high enough but I don't want to push my phone past that cause that's what broke it before.

even if bestbuy seems to be the only place that will replace it whether or not its unlocked/rooted
[Xperia Play Android Development] farenheith:
These changes are not compatible with CM7, because CM7 doesn't track the touchpad in the framework, just via JNI. Also, CM7 doesn't have onGenericMotionEvent, that is the trick of all this fix.

To do something like that in CM7, you'll need to make the framework talk with the touchpad, and this is a very hard work. If you compare the input events treatment of CM9 and CM7, you will see how much change to make this communication with multiple touch inputs transparently.

Unless, of course, if you get an idea to a workaround (what I did here :P)
[Xperia Play Android Development] NeWCuLTKiNG:
That's what I was saying would be best on cm7
[Xperia Play Android Development] cj360:
Aww, did not realize that. Still I'll look into it sometime at least. Once my sd card is done backing up I'm gona update the fix for aokp. I forgot to include the fix for shadowgun and the newest one.
[Xperia Play Android Development] benben972:
Tintin HD OK on v 0.4

Fifa 12 downloading...try 0.5 after !

Edit: Fifa works on 0.4 !! For FC in main menu just quickly tap on "game mode" or any section BEFORE FC and it's good :D.

Try 0.5 now

Edit 2: After 0.5 same issue for Fifa, Lara croft OK but tintin FC when i touch right touchpad :-\
[Xperia Play Android Development] farenheith:
Nice fifa works!

I need a Logcat for the FCs so I can take a look in the reason, can you get it to me?
[Xperia Play Android Development] benben972:
Back to 0.4

Six guns FC in 0.5, Fifa 12 same issue and no FC again for Tintin...

I have FC for Asphalt 7 too...strange :/

I sent Fifa 12 logcat in MP
[Xperia Play Android Development] farenheith:
Well six guns is free, that's a start. I'll put a link to the 0.4 , so, in the OP if we have some problems with the 0.5 yet
[Xperia Play Android Development] farenheith:
Dude, I'm playing six gun on the 0.5.

The first time I tried the game closed, and the second too, but I couldn't get the logcat on these attemps, but, when I tried the third time, the game open and I'm playing it. Quite good :P

Edit: I clear the six guns data and tried to get some FC again, but the games works well. I really don't know why the two FC on the first two attemps, but now it's all working well, even after clear the data.

About the fifa, this lines is the important one of the logcat:

09-28 14:48:04.612 D/AndroidRuntime(12152): Shutting down VM
09-28 14:48:04.612 W/dalvikvm(12152): threadid=1: thread exiting with uncaught exception (group=0x2b4e71f8)
09-28 14:48:04.632 E/AndroidRuntime(12152): FATAL EXCEPTION: main
09-28 14:48:04.632 E/AndroidRuntime(12152): java.lang.ExceptionInInitializerError
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.service.AbstractHostProvider.<init>(AbstractHostProvider.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.service.AdHostProvider.<init>(AdHostProvider.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.service.HostsProviderManager.getAdProvider(HostsProviderManager.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.network.request.AbortableAsyncTask.<init>(AbortableAsyncTask.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.downloadtracker.TrackDownloadRequest.<init>(TrackDownloadRequest.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.network.request.RequestManager.makeDownloadTrackRequest(RequestManager.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.downloadtracker.DownloadTrackingManager.sendDTRequestIfNeeded(DownloadTrackingManager.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.ui.BurstlyView.<init>(BurstlyView.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.burstly.lib.ui.BurstlyView.<init>(BurstlyView.java)
09-28 14:48:04.632 E/AndroidRuntime(12152):	at com.ea.game.fifa12.Fifa12Activity$1.run(Fifa12Activity.java)

I think it's some kind of download request, maybe to see if the game is updated or is properly licensed. Maybe if you clear the data the error stop? I know... it's 1,5 gb of data... is too much to clear...