[MOD][XXLPH][ICS] Phone Without Incremental Ringtone & Disabled Noise Suppression - Galaxy S II Themes and Apps

Thanks to Drorsi for his How to, ICS sources are close to GB ones.
Thanks to The_Ozyrys for his idea too.
Download (Flashable CWM For deodexed LPH Roms only) :
Phone with No Noise suppression & No Incremental Ringtone (ICS Themed): GT-I9100_WanamLite.LPH.NInc.NNR.Phone.ICSTheme
Phone with No Noise suppression & No Incremental Ringtone (Stock Theme): GT-I9100_WanamLite.LPH.NInc.NNR.Phone.StkTheme

and you can use PUMa for create aplet with this patches

Can u make Call Rec Mod with XXLPH??
http://forum.xda-developers.com/showthread.php?t=1516532

Great !!! work like a charme thankss
Envoyé depuis mon GT-I9100 avec Tapatalk

deadman12 said:
Can u make Call Rec Mod with XXLPH??
http://forum.xda-developers.com/showthread.php?t=1516532
Click to expand...
Click to collapse
I will try it.

mathsmart said:
Great !!! work like a charme thankss
Envoyé depuis mon GT-I9100 avec Tapatalk
Click to expand...
Click to collapse
+1..perfect. Thanks.

Great job, man! Respect!

Great job! I am a fan of your roms and your ICS v9.0 has been running very smooth. Only glitch I've experienced was not being able to handle call waiting (unsure if it was rom related or carrier), and in the videos app when you select a tab it stays highlighted even if go to another one. So if you switch between all three tabs in video the whole top bar stays lit.
But enough of the sidetrack, what I was really hoping for, if you have time and/or the heart, would you be able to make a no increasing ringtone with noise suppression left untouched?
Thanks for all your hard work!

works perfectly. thanx wanam!!!
edit: will you update this mod with the new releases of the ics rom?

seagerfreak said:
works perfectly. thanx wanam!!!
edit: will you update this mod with the new releases of the ics rom?
Click to expand...
Click to collapse
Yes.
10 chars.

Wanam:
Did you use this on the 10.2?
I tried to use Drorsi "How To" to revert, but I couldn't.
I found the line, but is different:
on his is: v8, v3, v9
but on your apk is v0, v1, v1
I tried to put v8, v3, v9 back but it didn't work... FC all the time!
I'm using APKTool...
---------- Post added at 11:12 AM ---------- Previous post was at 10:43 AM ----------
Another try:
add:
.local v3, noise_reduction:Z
Replace 1st v1 for v3
No go too...
I think I'm having some trouble with apktool... not sure i'm using right...
---------- Post added at 12:02 PM ---------- Previous post was at 11:12 AM ----------
Another try:
Got the classes.dex
baskmali
add:
.local v3, noise_reduction:Z
Replace 1st v1 for v3
smali
replace classes.dex on .apk
FC all the time...

Reverting this don't work too...
tarobun said:
I found the best way to change the default noise suppression was to change the noise_reduction variable in CallNotifier.smali from 0x1 (true) to 0x0 (false).
Fix also works from the beginning of call.
ie.
From
Code:
.line 971
const/4 v3, 0x1
.line 975
.local v3, noise_reduction:Z
to
Code:
.line 971
const/4 v3, [COLOR="Red"][b]0x0[/b][/COLOR]
.line 975
.local v3, noise_reduction:Z
Click to expand...
Click to collapse
But now my apks is working... just with NR disable....

Ciceroripi said:
Reverting this don't work too...
But now my apks is working... just with NR disable....
Click to expand...
Click to collapse
I will use this second solution next time so you can revert.

wanam said:
I will use this second solution next time so you can revert.
Click to expand...
Click to collapse
Tks! That wold be great!
But just to be sure we are on the same page:
1-) What's the best way to decompile/compile
a) apktool (then I use apk-multi-tool to sign)
b) remove classes.dex from apk, baskmali, chage, smali, put new classes.dex on the old apk
c) some other way: please, do explain(simple as b, a'll try to cacth up)
2- 2º solution is?
a)
Code:
#add:
.local v3, noise_reduction:Z
#Replace to this
invoke-static {v0, [COLOR="Red"]v3[/COLOR], v1}, Lcom/android/phone/PhoneUtils;->turnOnNoiseSuppression(Landroid/content/Context;ZZ)V
b)
From
Code:
Code:
.line 971
const/4 v3, 0x1
.line 975
.local v3, noise_reduction:Z
to
Code:
Code:
.line 971
const/4 v3, 0x0
.line 975
.local v3, noise_reduction:Z
Problem with this solution: this line
Code:
.local v3, noise_reduction:Z
Don't exists on your code
c) If you explain I'll do it your way, no problem...
One other thing: You can make avaliable the original phone.apk... I'll change the pngs so it gets the ICS look...

Related

[Fix] Decrease home button lag

Hi all, hope this is the right forum.
This thread is meant for ROM cooks only!
Let's start: I found a way to decrease the home button lag and would like to share this fix with you.
Some theory first:
The way from home button click to the home screen can be separated in two parts:
System will wait about 0.5s for another tap. This is due to the double click to voice-search feature, Samsung implemented. You won't find this lag on any other phone.
The good news is, that we can avoid it with some changes in framework.
The second part is the time the launcher needs to load. It's about 0.3 - 0.5 sec, depending on which app is currently running.
Now to the fix:
You have to decompile android.policy.jar (framework folder) using baksmali.
Open com\android\internal\policy\impl\PhoneWindowManager.smali and search for lines 3896 to 3922. They should look like this:
Code:
const/4 v4, 0x3
move/from16 v0, p4
move v1, v4
if-ne v0, v1, :cond_1
.line 1279
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyDoubleClickConcept:Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;
move-object v4, v0
move-object v0, v4
move/from16 v1, p2
move/from16 v2, p7
move v3, v13
invoke-virtual {v0, v1, v2, v3}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->addAction(IIZ)V
.line 1288
:cond_1
Delete all of these lines.
Now go a few lines deeper to lines 3920 - 3922. They should be
Code:
invoke-virtual {v4, v5}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
.line 1294
Replace these two lines with:
Code:
invoke-virtual {v4, v5}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
[COLOR="SeaGreen"] move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
move v4, v0
[COLOR="Red"] if-eqz v4, :cond_2[/COLOR]
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR]
.line 1294
(Note that the first and last line are the original ones.)
Warning: take a look at line 3933. If it is not ":cond_2", you have to replace the cond_2 in "if-eqz v4, :cond_2" with the cond from line 3933.
It looks like the naming sceme depends on the baksmali version you're using.
Now recompile with smali and you're done
Some notes:
The device will no longer wait for double clicks of home key. This means, that the voice-search obviously can no longer be started with a double-tap on home key.
You will still notice some lag on home key. That's the time the home launcher needs to load. Try it from within the launcher (for example in the app chooser) and it will react instant. It should now be comparable to any other phone.
The given line-numbers are from a KH3 ROM. The numbers may change in future roms.
I would call this fix "experimental". I tested it for a few days without any issues, but I can't guarantee that it is bug free.
The problem is, that Samsung made the single click listener depend on the double click listener, so removing the double-click listener might cause some problems.
That's it. I hope, I could help you
Very nicely done! This will be in the next Cognition release!
Great news... Thanks for the idea
Anyone wanna compile this into an update.zip for the lazy? :-D
designgears said:
Very nicely done! This will be in the next Cognition release!
Click to expand...
Click to collapse
woooo hoooo
cheers
DG
Working great!
Many thanks mate!
Thanks so much for this fix !
Excellent tweak OP, thank you!
I had a problem with this line:
Code:
if-eqz v4, :cond_2
smali complained about it during recompilation of Batista framework.
Just change it to next cond_[something] you find just after the part you inserted.
The Devs/Cooks are going to LOVE you! The flac they've copped recently from thus 'bug'/feature has been enoumous!
Sent from my GT-I9100 using XDA Premium App
Will this produce the same effect as removing voice command or will it make it faster than that?
Thanks!
Thank you very much!! Marvelous!
I'll include it in my next rom thx!
Inviato dal mio GT-I9100 usando Tapatalk
xan said:
I had a problem with this line:
Code:
if-eqz v4, :cond_2
smali complained about it during recompilation of Batista framework.
Just change it to next cond_[something] you find just after the part you inserted.
Click to expand...
Click to collapse
I was having the same issue. Thanks for that. I also didn't realize that the .smali had to be closed when recompiling LOL
Just pushed it to the frameworks folder. Rebooting and trying!
Yay, stuck at boot screen lol. I'll be honest, I don't know much about this stuff so I probably screwed something up...
This was my procedure:
1) Copied /framework to my computer
2) Downloaded baksmali/smali from the Google code page
3) In command prompt, did the following:
java -jar baksmali-1.2.7.jar -c core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x android.policy.odex
Click to expand...
Click to collapse
4) Opened the file using word, deleted the lines (even though my :cond_1 was :cond_42 I think)
5) Replaced the other section and used :cond_57 as you suggested
6) Did the following in command prompt:
java -jar smali-1.2.7.jar out -o android.policy.odex
Click to expand...
Click to collapse
7) Copied the new android.policy.odex to my framework folder and changed the permissions to all read/owner write
8) Rebooted
Where did I go wrong? I did this while running the Frakenstein'd KH3 ROM. Is this only for DEODEXED ROMs?
Awesome. Just mod mine, works great.
As mentioned earlier is there any possibility to a CWM zip
you are a hero! will send youna beer in a few hours, you don't know how happy I am right now
Sent from my GT-I9100 using XDA Premium App
Will be in my next rom release thanks man
Kudos to you man, this is amazing.. Will make a lot happy.
advance users must help newbies, please provide cwm zip file
Sent from my GT-I9100 using XDA Premium App
Can someone figure out where I went wrong in my above procedure?
Thanks!

[MOD][ZSALED][SecPhone] Enable Call Recording

This is simple howto enable Call recording on the Galaxy S3 Firmewares.
You need to decompile SecPhone.apk, use my repacked Apk_Manager (it should work for any ICS file 4.0.3/4.0.4).
Open "SecPhone.apk\smali\com\android\phone\PhoneFeature.smali", and make the changes :
Code:
const-string v7, "voice_call_recording"
invoke-virtual {v8}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_e
invoke-virtual/range {v19 .. v19}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_e
invoke-virtual {v11}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_e
invoke-virtual/range {v19 .. v19}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-eqz v1, :cond_40
:cond_e
[COLOR=SeaGreen] ++:goto_12[/COLOR]
const/4 v1, 0x1
[COLOR=Red] --:goto_12[/COLOR]
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
You may get different "goto" IDs, so make the changes depending on your IDs.
Tested on my stock and custom Deodexed ZSALED with no need to replace any lib (unlike sgs2).
GT-I9300_WanamLite.ZSALED.Enable.Call.Recording.zip ( + Disabled increasing ringtone), Backup before flashing!
Thank you for sharing my friend!
Works great
Thanks Wanam for sharing this, trying now
HELP!
I tried to install the zip through the CWM.
I didnt found "SecPhone.apk\smali\com\android\phone\PhoneFeature .smali"
Now my phone GET FC all the time! i cant answer ppls or call them!
Please help!
Awesome Bro! This will help a lot.
romaninja said:
HELP!
I tried to install the zip through the CWM.
I didnt found "SecPhone.apk\smali\com\android\phone\PhoneFeature .smali"
Now my phone GET FC all the time! i cant answer ppls or call them!
Please help!
Click to expand...
Click to collapse
What Rom? odexed or deodexed?
wanam said:
What Rom? odexed or deodexed?
Click to expand...
Click to collapse
Stock rom
(I think its IMM76D.i9300JKALE2)
Can you tell me how to make the record work from here or how to reverse settings? (prefer to rec)
romaninja said:
Stock rom
(I think its IMM76D.i9300JKALE2)
Can you tell me how to make the record work from here or how to reverse settings? (prefer to rec)
Click to expand...
Click to collapse
It was stated that it's for deodexed Roms!
Try to remove "/system/app/secPhone.odex".
This is awesome, thanks wanam. Anyone try it on XXALEF yet?
wanam said:
This is simple howto enable Call recording on the Galaxy S3 Firmewares.
You need to decompile SecPhone.apk, use my repacked Apk_Manager (it should work for any ICS file 4.0.3/4.0.4).
Open "SecPhone.apk\smali\com\android\phone\PhoneFeature.smali", and make the changes :
Code:
const-string v7, "voice_call_recording"
invoke-virtual {v8}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_e
invoke-virtual/range {v19 .. v19}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_e
invoke-virtual {v11}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-nez v1, :cond_e
invoke-virtual/range {v19 .. v19}, Ljava/lang/Boolean;->booleanValue()Z
move-result v1
if-eqz v1, :cond_40
:cond_e
[COLOR=SeaGreen] ++:goto_12[/COLOR]
const/4 v1, 0x1
[COLOR=Red] --:goto_12[/COLOR]
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
You may get different "goto" IDs, so make the changes depending on your IDs.
Tested on my stock and custom Deodexed ZSALED with no need to replace any lib (unlike sgs2).
GT-I9300_WanamLite.ZSALED.Enable.Call.Recording.zip ( + Disabled increasing ringtone), Backup before flashing!
Click to expand...
Click to collapse
hey wanam. glad to see u here too
My voice is to low, the other parts voice is perfect...
Thank you
jnannetti said:
My voice is to low, the other parts voice is perfect...
Thank you
Click to expand...
Click to collapse
Try disabling noise suppression while calling.
wanam said:
Try disabling noise suppression while calling.
Click to expand...
Click to collapse
stills low... thank you...
Sent from my GT-I9300 using Tapatalk 2
The recording works even on custom rom! Just install it through CWM and with root explorer delete secphone.odex in system app!
Sent from my GT-I9300 using XDA
Working nice! Although my voice is very low. Is it possible to fix this?
Another usefull option would be auto recording.
Thanks for your work!
p.s. Any idea why the record button is disabled when bluetooth headset is connected?
Strange Behaviour ...
Finally, it seems that I can record phone calls; however, there seems to be an odd glitch.
If I make a call or when a call comes in, if I then press the Record button, nothing happens. It usually takes at least 4-5 attempts at pressing the Record button before I finally see the red dot flashing, which would indicate that recording has begun. Any idea why it never works on my first attempt?
Also, is there a way of setting up the system to ALWAYS record all calls ... without the need for pressing a button?
Thanks,
Peter
---------- Post added at 08:05 AM ---------- Previous post was at 08:03 AM ----------
cmd512 said:
This is awesome, thanks wanam. Anyone try it on XXALEF yet?
Click to expand...
Click to collapse
I'm on XXALEF, and it seems to work, but if you read my earlier post above, it takes at least 4-5 attempts at pressing the Record button before it actually starts recording.
Peter
Quick question to confirm, is this call recording capability dependant on phone baseband?
I was trying to decompile the SecPhone.apk file with the magic Apk_Manager you posted,
But was getting Java heap problems. As my PC is far from low-end... I modified the Script.bat with Xmx2048m instead of some var there, and it worked!
Lol, I am totally noob at this.
After messing around a little more I noticed the tool specifies it's working @ 64MB heap size, and it's a standard option there to increase it.
If anyone has done this for LE8 i'd appreciate if you could upload. I've had a go but java is crapping out on me.
Still having problems decompiling/Recompiling.
1. Should I be using decompile with dependencies?
2. If so, How do I specify both of them with the drag and drop thingy?
3. Thanks.

[MOD][JB/ICS][10/21/2012][AOKP JB-B5/M6] Vibrate on call connect/answer

[Update 10/21/2012]
Added Phone.apk for AOKP JB Build 5;
This thread is dedicated to the method of modifying Phone.apk so that when an outgoing call is connected (answered) the phone vibrates to notify. This feature is useful when driving and is good for health as the wireless signal boosts at the instant when a call is connected so it is better to keep it at a distance and be notified as soon as it is connected.
The method here is inspired by the codes in CM9, but much simpler: only less than 30 lines of smali codes are added to a single file. It works on the latest Phone.apk source codes, and also a modded Phone.apk for AOKP M6 is provided as an attachment. Feel free to mod it in your own ROM, but I just did for AOKP (at least for now) since I would stick to that ROM for best LED notification support.
After baksmali-ing Phone.apk, the file to modify is CallNotifier.smali. Added codes are marked by "+" and "+ { }" and are in red. All modifications below are based on AOKP M6.
1. Add two instance variables
Code:
# instance fields
...
[COLOR="Red"]+.field private mVibrator:Landroid/os/Vibrator;
+.field private mLastVibratedCall:J
[/COLOR]
2. Modify init method to initialize Vibrator
Code:
.method private constructor <init>(Lcom/android/phone/PhoneApp;Lcom/android/internal/telephony/Phone;Lcom/android/phone/Ringer;Lcom/android/phone/BluetoothHandsfree;Lcom/android/phone/CallLogAsync;)V
.registers 11
.parameter "app"
.parameter "phone"
.parameter "ringer"
.parameter "btMgr"
.parameter "callLog"
.prologue
const/4 v3, 0x0
.line 198
invoke-direct {p0}, Landroid/os/Handler;-><init>()V
[COLOR="red"]+ new-instance v2, Landroid/os/Vibrator;
+ invoke-direct {v2}, Landroid/os/Vibrator;-><init>()V
+ iput-object v2, p0, Lcom/android/phone/CallNotifier;->mVibrator:Landroid/os/Vibrator;
[/COLOR]
.line 105
iput-boolean v3, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTimeOut:Z
Note: for JB, use
Code:
[COLOR="red"]+ new-instance v2, Landroid/os/SystemVibrator;;
+ invoke-direct {v2}, Landroid/os/SystemVibrator;-><init>()V
[/COLOR]
3. Add the codes in method onPhoneStateChanged to implement the vibrate logic when an outgoing call is connected (with removal of potential repetitive vibrates). This happens right after the CallWaitingTonePlayer codes and before the setAudioMode codes.
Code:
.method private onPhoneStateChanged(Landroid/os/AsyncResult;)V
...
if-ne v4, v6, :cond_ae
.line 801
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTonePlayer:Lcom/android/phone/CallNotifier$InCallTonePlayer;
if-eqz v6, :cond_72
.line 802
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTonePlayer:Lcom/android/phone/CallNotifier$InCallTonePlayer;
invoke-virtual {v6}, Lcom/android/phone/CallNotifier$InCallTonePlayer;->stopTone()V
.line 803
iput-object v13, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTonePlayer:Lcom/android/phone/CallNotifier$InCallTonePlayer;
.line 808
:cond_72
[COLOR="red"]+ {
invoke-interface {v3}, Lcom/android/internal/telephony/Phone;->getForegroundCall()Lcom/android/internal/telephony/Call;
move-result-object v6
invoke-virtual {v6}, Lcom/android/internal/telephony/Call;->getState()Lcom/android/internal/telephony/Call$State;
move-result-object v6
sget-object v9, Lcom/android/internal/telephony/Call$State;->ACTIVE:Lcom/android/internal/telephony/Call$State;
if-ne v6, v9, :cond_72end
invoke-interface {v3}, Lcom/android/internal/telephony/Phone;->getForegroundCall()Lcom/android/internal/telephony/Call;
move-result-object v6
invoke-virtual {v6}, Lcom/android/internal/telephony/Call;->getLatestConnection()Lcom/android/internal/telephony/Connection;
move-result-object v6
invoke-virtual {v6}, Lcom/android/internal/telephony/Connection;->isIncoming()Z
move-result v9
if-nez v9, :cond_72end
invoke-virtual {v6}, Lcom/android/internal/telephony/Connection;->getCreateTime()J
move-result-wide v5
iget-wide v9, p0, Lcom/android/phone/CallNotifier;->mLastVibratedCall:J
cmp-long v9, v5, v9
if-eqz v9, :cond_72end
iput-wide v5, p0, Lcom/android/phone/CallNotifier;->mLastVibratedCall:J
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mVibrator:Landroid/os/Vibrator;
const-wide/16 v9, 0x100
invoke-virtual {v6, v9, v10}, Landroid/os/Vibrator;->vibrate(J)V
:cond_72end
}
[/COLOR]
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mCM:Lcom/android/internal/telephony/CallManager;
invoke-static {v6}, Lcom/android/phone/PhoneUtils;->setAudioMode(Lcom/android/internal/telephony/CallManager;)V
...
As you can see only a small amount of codes is needed to implement the feature. What the mod does in detail:
(1) When a call changes its state to ACTIVE,
(2) Check if it is outgoing,
(3) Also check if it has already vibrated on connect/answer (if we don't have this code then an outgoing connected call will vibrate each time the Phone app switches in/out home screen),
(4) If Y in (2) and N in (3), then vibrate and store the creation time of this call for future checks in (3).
Note that the codes do not create any new objects when a call is connected/answered so the memory overhead should be approximately zero.
See attachment for the modded Phone.apk for AOKP M6. I may do it also for JB ROMs when I switch to them. If you want to cook this mod into your own ROM feel free to do so.
Phone.apk for AOKP JB Build 5 is added on 10/21/2012.
Is this working with JB roms? Just flash this phone.apk in cwm?
Sent from my Galaxy Nexus using xda app-developers app
Great work ! ! ! I tried the modified .apk for AOKP M6 and it works.
The vibration upon call connect is very responsive. I mean... on my girlfriend's Desire S running MIUI, it is delayed by half a second or so.
It'd be nice if it would vibrate when the call disconnects, too.
Sent from my Galaxy Nexus
what about the noob people like me
is there ready flashable or apk file can be installed directly, I tried to installed the attached file but have not installed message
Sent from my Galaxy Nexus using Tapatalk 2
lupipe said:
Is this working with JB roms? Just flash this phone.apk in cwm?
Sent from my Galaxy Nexus using xda app-developers app
Click to expand...
Click to collapse
+1
how to install this on JB rom?!
Hash123 said:
what about the noob people like me
is there ready flashable or apk file can be installed directly, I tried to installed the attached file but have not installed message
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
true true what about us?:laugh:
Hash123 said:
what about the noob people like me
is there ready flashable or apk file can be installed directly, I tried to installed the attached file but have not installed message
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Copy and paste the attached Phone.apk into your /system/app/ folder. Rewrite the existing file, obviously. As the OP said, it's for AOKP M6, but I have a feeling it should work on CM9, AOSP and such... except for ParanoidAndroid and MIUI, of course.
---------- Post added at 03:58 PM ---------- Previous post was at 03:57 PM ----------
lupipe said:
Is this working with JB roms? Just flash this phone.apk in cwm?
Sent from my Galaxy Nexus using xda app-developers app
Click to expand...
Click to collapse
Good luck flashing an .apk from Recovery. Or anything that is not .zip, for that matter...
Formhault said:
Copy and paste the attached Phone.apk into your /system/app/ folder. Rewrite the existing file, obviously. As the OP said, it's for AOKP M6, but I have a feeling it should work on CM9, AOSP and such... except for ParanoidAndroid and MIUI, of course.
---------- Post added at 03:58 PM ---------- Previous post was at 03:57 PM ----------
Good luck flashing an .apk from Recovery. Or anything that is not .zip, for that matter...
Click to expand...
Click to collapse
Just moved this phone.apk in system/app but it says cannot copy...im on jb 4.1.1
Sent from my Galaxy Nexus using xda app-developers app
Very nice work, Maybe I should give it a try .
mrzzheng said:
This thread is dedicated to the method of modifying Phone.apk so that when an outgoing call is connected (answered) the phone vibrates to notify. This feature is useful when driving and is good for health as the wireless signal boosts at the instant when a call is connected so it is better to keep it at a distance and be notified as soon as it is connected.
The method here is inspired by the codes in CM9, but much simpler: only less than 30 lines of smali codes are added to a single file. It works on the latest Phone.apk source codes, and also a modded Phone.apk for AOKP M6 is provided as an attachment. Feel free to mod it in your own ROM, but I just did for AOKP (at least for now) since I would stick to that ROM for best LED notification support.
After baksmali-ing Phone.apk, the file to modify is CallNotifier.smali. Added codes are marked by "+" and "+ { }" and are in red. All modifications below are based on AOKP M6.
1. Add two instance variables
Code:
# instance fields
...
[COLOR="Red"]+.field private mVibrator:Landroid/os/Vibrator;
+.field private mLastVibratedCall:J
[/COLOR]
2. Modify init method to initialize Vibrator
Code:
.method private constructor <init>(Lcom/android/phone/PhoneApp;Lcom/android/internal/telephony/Phone;Lcom/android/phone/Ringer;Lcom/android/phone/BluetoothHandsfree;Lcom/android/phone/CallLogAsync;)V
.registers 11
.parameter "app"
.parameter "phone"
.parameter "ringer"
.parameter "btMgr"
.parameter "callLog"
.prologue
const/4 v3, 0x0
.line 198
invoke-direct {p0}, Landroid/os/Handler;-><init>()V
[COLOR="red"]+ new-instance v2, Landroid/os/Vibrator;
+ invoke-direct {v2}, Landroid/os/Vibrator;-><init>()V
+ iput-object v2, p0, Lcom/android/phone/CallNotifier;->mVibrator:Landroid/os/Vibrator;
[/COLOR]
.line 105
iput-boolean v3, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTimeOut:Z
3. Add the codes in method onPhoneStateChanged to implement the vibrate logic when an outgoing call is connected (with removal of potential repetitive vibrates). This happens right after the CallWaitingTonePlayer codes and before the setAudioMode codes.
Code:
.method private onPhoneStateChanged(Landroid/os/AsyncResult;)V
...
if-ne v4, v6, :cond_ae
.line 801
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTonePlayer:Lcom/android/phone/CallNotifier$InCallTonePlayer;
if-eqz v6, :cond_72
.line 802
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTonePlayer:Lcom/android/phone/CallNotifier$InCallTonePlayer;
invoke-virtual {v6}, Lcom/android/phone/CallNotifier$InCallTonePlayer;->stopTone()V
.line 803
iput-object v13, p0, Lcom/android/phone/CallNotifier;->mCallWaitingTonePlayer:Lcom/android/phone/CallNotifier$InCallTonePlayer;
.line 808
:cond_72
[COLOR="red"]+ {
invoke-interface {v3}, Lcom/android/internal/telephony/Phone;->getForegroundCall()Lcom/android/internal/telephony/Call;
move-result-object v6
invoke-virtual {v6}, Lcom/android/internal/telephony/Call;->getState()Lcom/android/internal/telephony/Call$State;
move-result-object v6
sget-object v9, Lcom/android/internal/telephony/Call$State;->ACTIVE:Lcom/android/internal/telephony/Call$State;
if-ne v6, v9, :cond_72end
invoke-interface {v3}, Lcom/android/internal/telephony/Phone;->getForegroundCall()Lcom/android/internal/telephony/Call;
move-result-object v6
invoke-virtual {v6}, Lcom/android/internal/telephony/Call;->getLatestConnection()Lcom/android/internal/telephony/Connection;
move-result-object v6
invoke-virtual {v6}, Lcom/android/internal/telephony/Connection;->isIncoming()Z
move-result v9
if-nez v9, :cond_72end
invoke-virtual {v6}, Lcom/android/internal/telephony/Connection;->getCreateTime()J
move-result-wide v5
iget-wide v9, p0, Lcom/android/phone/CallNotifier;->mLastVibratedCall:J
cmp-long v9, v5, v9
if-eqz v9, :cond_72end
iput-wide v5, p0, Lcom/android/phone/CallNotifier;->mLastVibratedCall:J
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mVibrator:Landroid/os/Vibrator;
const-wide/16 v9, 0x100
invoke-virtual {v6, v9, v10}, Landroid/os/Vibrator;->vibrate(J)V
:cond_72end
}
[/COLOR]
iget-object v6, p0, Lcom/android/phone/CallNotifier;->mCM:Lcom/android/internal/telephony/CallManager;
invoke-static {v6}, Lcom/android/phone/PhoneUtils;->setAudioMode(Lcom/android/internal/telephony/CallManager;)V
...
As you can see only a small amount of codes is needed to implement the feature. What the mod does in detail:
(1) When a call changes its state to ACTIVE,
(2) Check if it is outgoing,
(3) Also check if it has already vibrated on connect/answer (if we don't have this code then an outgoing connected call will vibrate each time the Phone app switches in/out home screen),
(4) If Y in (2) and N in (3), then vibrate and store the creation time of this call for future checks in (3).
Note that the codes do not create any new objects when a call is connected/answered so the memory overhead should be approximately zero.
See attachment for the modded Phone.apk for AOKP M6. I may do it also for JB ROMs when I switch to them. If you want to cook this mod into your own ROM feel free to do so.
Click to expand...
Click to collapse
Thank you. jb aspect version. thanks
Formhault said:
Copy and paste the attached Phone.apk into your /system/app/ folder. Rewrite the existing file, obviously. As the OP said, it's for AOKP M6, but I have a feeling it should work on CM9, AOSP and such... except for ParanoidAndroid and MIUI, of course.
---------- Post added at 03:58 PM ---------- Previous post was at 03:57 PM ----------
Good luck flashing an .apk from Recovery. Or anything that is not .zip, for that matter...
Click to expand...
Click to collapse
I did as you said, replaced the phone.apk file with the modified on but nothing was changed , I am on AOKP M6
Hash123 said:
I did as you said, replaced the phone.apk file with the modified on but nothing was changed , I am on AOKP M6
Click to expand...
Click to collapse
restart to let the magic happen.
lupipe said:
Just moved this phone.apk in system/app but it says cannot copy...im on jb 4.1.1
Sent from my Galaxy Nexus using xda app-developers app
Click to expand...
Click to collapse
That's because the Phone.apk is for AOKP M6, which is based on 4.0.4. That file might work on other 4.0.4-based ROMs, but no way it's gonna work on JB...
Hash123 said:
I did as you said, replaced the phone.apk file with the modified on but nothing was changed , I am on AOKP M6
Click to expand...
Click to collapse
When I replaced the file and went into the Phone, Contacts stopped working. So I figured a reboot is requred. Restarted the phone and everything was fine .
I flashed this mod today... I sold my Nexus today... Happy & sad at the same time. Oh well... guess I'll be off this topic/forum, lol.
Hello. you can do. version. jb? thanks: Rolleyes:
mrzzheng said:
restart to let the magic happen.
Click to expand...
Click to collapse
Formhault said:
That's because the Phone.apk is for AOKP M6, which is based on 4.0.4. That file might work on other 4.0.4-based ROMs, but no way it's gonna work on JB...
When I replaced the file and went into the Phone, Contacts stopped working. So I figured a reboot is requred. Restarted the phone and everything was fine .
I flashed this mod today... I sold my Nexus today... Happy & sad at the same time. Oh well... guess I'll be off this topic/forum, lol.
Click to expand...
Click to collapse
yes you are right, it is working as should be
Sent from my Galaxy Nexus using Tapatalk 2
Can someone make this mod for JB?
Sent from my Galaxy Nexus using xda app-developers app
Can someone make this mod for JB? thanks
I hope you can make a JB version, since this is a very useful feature
Sent from my GT-P6200 using xda app-developers app
So does it work with JB or not?

[Manual] Proper CRT-OFF for JB

Here is manual, how to make CRT-OFF mod without glitches on JB.
Originally, it has been released in my UNIROM ROM in 4PDA.ru community.
Here is the guide. Instruction is based on I9300XXDLIB, but it's easy to adjust it to other ROMS.
To make CRT-OFF working, you need to decompile services.jar.
in file com\android\server\PowerManagerService$ScreenBrightnessAnimator.smali
find following code and modify it according to red colored part:
Code:
.line 2906
.end local v0 #delta:I
:cond_1
:goto_1
iget-object v7, p0, Lcom/android/server/PowerManagerService$ScreenBrightnessAnimator;->this$0:Lcom/android/server/PowerManagerService;
#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7300(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;
move-result-object v7
[COLOR=Red] if-eqz p2, :cond_2xx
const/16 v9, 0xb
const/4 v10, 0x0
const v2, 0x10
invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v9
invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V
:cond_2xx
[/COLOR] const/16 v9, 0xa
invoke-virtual {v7, v9}, Landroid/os/Handler;->removeMessages(I)V
Black color is original code, you need to find.
Effect will start to work, but u will notice glitch: if you turn on screen by power button and then put it to sleep again by button without unlocking then phone will wake up just after CRT effect finishes.
Here is workaround part.
decompile android.policy.jar.
in file com\android\internal\policy\impl\PhoneWindowManager.smali
Find following parts (black is original code) and modify according to red text:
Code:
.class public Lcom/android/internal/policy/impl/PhoneWindowManager;
.super Ljava/lang/Object;
.source "PhoneWindowManager.java"
# interfaces
.implements Landroid/view/WindowManagerPolicy;
[COLOR=Red].implements Ljava/lang/Runnable;[/COLOR]
# annotations
Code:
.line 5411
.end local v9 #isAllowed:Z
.end local v16 #kioskMode:Landroid/app/enterprise/kioskmode/KioskMode;
:cond_1
:goto_2
[COLOR=Red] and-int/lit8 v0, v19, 0x4
if-eqz v0, :cond_2xx
and-int/lit8 v19, v19, -0x5
move-object/from16 v0, p0
invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sleepDelay()V
:cond_2xx
[/COLOR] return v19
at the end of file add following code:
Code:
[COLOR=Red].method public sleepDelay()V
.locals 10
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const-wide v2, 0x64
check-cast p0, Ljava/lang/Runnable;
invoke-virtual {v0, p0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end method
.method public run()V
.locals 10
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v1, "power"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v2
const-wide/16 v6, 0x3e8
add-long/2addr v2, v6
invoke-virtual {v0, v2, v3}, Landroid/os/PowerManager;->goToSleep(J)V
return-void
.end method
[/COLOR]
That's all.
My method doesn't require patches for libsurfaceflinger.so library.
P.S.: I didn't put much effort to investigate of possibility for CRT-ON effect. I'm not sure if this effect is even compiled inside stock libsurfaceflinger.so. I'm happy that i could achieve fully working CRT-OFF without patching library. I remember how much time i've spent to patch libsurfaceflinger.so for I9100 ICS ROM against flicker, so it's real deal breaker for me to go through reversing and patching of .so file again.
I've attached mod for XXDLIB version.
Install in CWM recovery to DEODEXED ROM.
This is for stock deodexed I9300XXDLIB ROM. If you use any custom made ROM and there are some additional modifications in android.policy.jar or services.jar then you will loose all those mods.
I have neither time no ability to make flashable zips for other ROMs. I cannot download every ROM, integrate this mod and test. So, ask custom ROMs authors to integrate it into their ROMs by themself.
you may post the whole thing, already ready to be flashed? you'll be very grateful
I can post mod for XXDLIB version, but if you have other mods integrated in these framework files, you will loose them.
sorg said:
I can post mod for XXDLIB version, but if you have other mods integrated in these framework files, you will loose them.
Click to expand...
Click to collapse
would be good for me, I use the WanamLite XXDLIB V3.8.
How did you decompile services.jar? I'd be happy with a link too, but I'd also like to know how to decompile jars
Kryten2k35 said:
How did you decompile services.jar? I'd be happy with a link too, but I'd also like to know how to decompile jars
Click to expand...
Click to collapse
It's for experienced in modifications users. If you don't know how to do it, then you won't make it right. So, wait for ready to flash mod, made by some one.
I've attached mod for XXDLIB version to the OP.
sorg said:
It's for experienced in modifications users. If you don't know how to do it, then you won't make it right. So, wait for ready to flash mod, made by some one.
I've attached mod for XXDLIB version to the OP.
Click to expand...
Click to collapse
Anybody try?? Work without this issue??
Works perfect on Wanam 3.7!
please is possible have this for odex stock rom dlib?? thanks for reply
sorg said:
I've attached mod for XXDLIB version to the OP.
Click to expand...
Click to collapse
work perfect..always on Wanam 3.7..thank you :good:
Just put this into my rom...works perfect, thanks for the guide
Sorgen, dass could you please provide a zip version in first post with included 4-way-reboot? Just recognized that it's gone with your mod because of the changed files.
Thanks m8!
sent with Samsungs unleashed beast using Tapatalk 2
hi Sorg, sorry for double request, is possible have this for odex rom DILB root? thanks for reply
sorg said:
It's for experienced in modifications users. If you don't know how to do it, then you won't make it right. So, wait for ready to flash mod, made by some one.
I've attached mod for XXDLIB version to the OP.
Click to expand...
Click to collapse
I know what I'm doing, I just haven't found any reliable tools to decompile jar's
Kryten2k35 said:
I know what I'm doing, I just haven't found any reliable tools to decompile jar's
Click to expand...
Click to collapse
a) you can rename jar to apk and use your favorite tool
b) apktool works fine with jars as well
c) use baksmali/smali tools
sorg said:
a) you can rename jar to apk and use your favorite tool
b) apktool works fine with jars as well
c) use baksmali/smali tools
Click to expand...
Click to collapse
Thanks. Last source I read suggested AndroidChef, which didn't work at all. I'll use apktool first and see how that goes.
uberto.costanzo said:
hi Sorg, sorry for double request, is possible have this for odex rom DILB root? thanks for reply
Click to expand...
Click to collapse
i can upload mods for ROMs i'm using. I'm using deodexed ROM. Since i often change something in ROM, deodexed version is the one suitable for me.
If you like to use mods, install stock deodexed ROM and you will have more freedom to install many different mods and hacks.
Here we go. CRT + Extended Pwer Menu.
Thanks Sorg, including this in my ROM
Kryten2k35 said:
Here we go. CRT + Extended Pwer Menu.
Thanks Sorg, including this in my ROM
Click to expand...
Click to collapse
Man, 10 mins faster than me
Great work as always!
sorg said:
It's for experienced in modifications users. If you don't know how to do it, then you won't make it right. So, wait for ready to flash mod, made by some one.
I've attached mod for XXDLIB version to the OP.
Click to expand...
Click to collapse
=-O Kryten is a matter chef
---------- Post added at 11:28 PM ---------- Previous post was at 11:26 PM ----------
Kryten2k35 said:
Here we go. CRT + Extended Pwer Menu.
Thanks Sorg, including this in my ROM
Click to expand...
Click to collapse
Just flash from recovery for Ultima 2.4?

[MOD] [HOW TO] Enable rotation lock tile on 4.4

As I know, this feature was hidden by google for any phone which screen size is smaller than 600 dp. ( dp = (px / dpi) * 160 ).
If you have root you can install GravityBox and easily get this tile. But if for some reason you do not wanna use gravitybox, there are few ways to do it:
How to simply enable it by changing framework.jar you can find here http://forum.xda-developers.com/showpost.php?p=29209182&postcount=13
How to enable this tile using only SystemUI.apk I'm gonna show you
1. SystemUI/res/values/bools.xml
find this bools and change them to true
Code:
<bool name="quick_settings_show_rotation_lock">true</bool>
<bool name="config_showRotationLock">true</bool>
Actually, I think this is not necessary. You can skip this step and return if it wont work
2.SystemUI\smali\com\android\systemui\statusbar\policy\RotationLockController.smali
Find this:
Code:
invoke-static {v0}, Lcom/android/internal/view/RotationPolicy;->isRotationLockToggleSupported(Landroid/content/Context;)Z
There will be four the same lines. And you should change it four times for each line.
Before:
Code:
invoke-static {v0}, Lcom/android/internal/view/RotationPolicy;->isRotationLockToggleSupported(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_0
After:
Code:
invoke-static {v0}, Lcom/android/internal/view/RotationPolicy;->isRotationLockToggleSupported(Landroid/content/Context;)Z
move-result v0
# if-eqz v0, :cond_0
3. SystemUI\smali\com\android\systemui\statusbar\phone\QuickSettings$15.smali
find method public refreshView
Before:
Code:
.line 1118
.local v0, "rotationLockState":Lcom/android/systemui/statusbar/phone/QuickSettingsModel$RotationLockState;
iget-boolean v1, v0, Lcom/android/systemui/statusbar/phone/QuickSettingsModel$RotationLockState;->visible:Z
if-eqz v1, :cond_2
const/4 v1, 0x0
After:
Code:
.line 1118
.local v0, "rotationLockState":Lcom/android/systemui/statusbar/phone/QuickSettingsModel$RotationLockState;
iget-boolean v1, v0, Lcom/android/systemui/statusbar/phone/QuickSettingsModel$RotationLockState;->visible:Z
#if-eqz v1, :cond_2
const/4 v1, 0x0
This is for XT1032 174.44.1.falcon_umts.Retail.en.US :http://forum.xda-developers.com/attachment.php?attachmentid=2674905&stc=1&d=1396965597 [LOCK.zip]
And I can not guarantee work on any other firmwares
Backup your original SystemUI.apk just in case if something goes wrong and you'll get bootloop or black screen.
thanks!!
Can you create others mods to add anothers functions on notification bar?
gameeater said:
thanks!!
Can you create others mods to add anothers functions on notification bar?
Click to expand...
Click to collapse
of course not. I didn't create it. It was created by google and I just let it be visible
not work
Thanks for your effort but this mod doesn't work on moto g xt1032 stock ROM and faux123 009m kernek ....
The issue is after flash this by CWM there is not any status bar anymore and there is not any navigation keys anymore
ekhatooni said:
Thanks for your effort but this mod doesn't work on moto g xt1032 stock ROM and faux123 009m kernek ....
The issue is after flash this by CWM there is not any status bar anymore and there is not any navigation keys anymore
Click to expand...
Click to collapse
Is your system version EXACTLY 174.44.1.falcon_umts.Retail.en.US ?Because as I said in 1st post
This is for XT1032 174.44.1.falcon_umts.Retail.en.US :http://forum.xda-developers.com/atta...1&d=1396965597 [LOCK.zip]
And I can not guarantee work on any other firmwares
Click to expand...
Click to collapse
Request
HI
you are right ..... My Version is 176.44.1.falcom_umts.TescoSL.en.GB
and my phones SystemUI.apk is already attached .....
Is it possible that enable the Rotation tile ????
thanks ....
Thanks, this worked on my Moto G. Not sure if I needed it because I never take off auto rotate but it's good to have it there.
My god! Why is it that you people never read the WHOLE post BEFORE flashing stuff?!
Sent from my XT1032 using XDA Free mobile app
For People with XT1032 EU Moto G
i just compiled the SystemUI.apk from the EU version of the Moto G XT1032 to make the Lock Rotation Tile visible
Maybe the Thread starter can put my apk as well to the first post ;D
Note that my modified SystemUI.apk is just for 176.44.1.falcon_umts.EURetail.en.EU (don't know if it works for other versions)

Categories

Resources