Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
drorsi
Old
#1  
Junior Member - OP
Thanks Meter 19
Posts: 3
Join Date: Jun 2007
Talking [HOWTO] Finally! a REAL solution to disable noise reduction

I searched a solution to disable NR in the beginning of the call. I had an echo problem in my phone, and the only way to fix it was to disable the NR.

The problem - each time you place or answer a call we need to go to menu and disable it.

All the codes that posted here didn't disable the NR. they only disabled the menu.

After digging for a few days in the smali of the Phone.apk I found the solution -

You need to edit CallNotifier.smali -

Search for - turnOnNoiseSuppression and rem the line

In my case it looks like this.

Code:
.line 957
    .local v3, noise_reduction:Z
    iget-object v8, p0, Lcom/android/phone/CallNotifier;->mApplication:Lcom/android/phone/PhoneApp;

    const/4 v9, 0x1

    # invoke-static {v8, v3, v9}, Lcom/android/phone/PhoneUtils;->turnOnNoiseSuppression(Landroid/content/Context;ZZ)V

And in PhoneApp$PhoneAppBroadcastReceiver.smali (not all APk's needs it)-

Code:
.line 1930
    sget-object v1, Lcom/android/phone/PhoneUtils$AMRState;->WB:Lcom/android/phone/PhoneUtils$AMRState;

    invoke-static {v1}, Lcom/android/phone/PhoneUtils;->setAMRCodec(Lcom/android/phone/PhoneUtils$AMRState;)V

    .line 1940
    :goto_9
    iget-object v1, p0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;->this$0:Lcom/android/phone/PhoneApp;

    invoke-virtual {v1}, Lcom/android/phone/PhoneApp;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/android/phone/PhoneUtils;->isSupportedNoiseReductionInWBMode(Landroid/content/Context;)Z

    move-result v1

    if-nez v1, :cond_21

    if-ne v0, v5, :cond_21

    iget-object v0, p0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;->this$0:Lcom/android/phone/PhoneApp;

    invoke-virtual {v0}, Lcom/android/phone/PhoneApp;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/android/phone/PhoneUtils;->isNoiseSuppressionOn(Landroid/content/Context;)Z

    move-result v0

    if-ne v0, v5, :cond_21

    .line 1943
    iget-object v0, p0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;->this$0:Lcom/android/phone/PhoneApp;

    invoke-virtual {v0}, Lcom/android/phone/PhoneApp;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    # invoke-static {v0, v4, v4}, Lcom/android/phone/PhoneUtils;->turnOnNoiseSuppression(Landroid/content/Context;ZZ)V
Different apk's versions may have different line number and variables numbers.

This change will make the phone starts calls with NR off. (may not work in the first call after the phone boots up - looking for a fix)
you can still turn it on if you want, during the call

Enjoy!
The Following 19 Users Say Thank You to drorsi For This Useful Post: [ Click to Expand ]
 
ctomgee
Old
#2  
Senior Member
Thanks Meter 894
Posts: 3,540
Join Date: Dec 2010
This is driving me insane.

I cannot, for the life of me, get a smali folder when I decompile Phone.apk. I've tried using APKManager 4.9, and directly using APKTool.

Using APKManager, I set my project, decompile with dependencies, drag twframework-res.apk when asked.

Using APKTool, I type:
apktool d Phone.apk

Both methods, all I get are a res folder, AndroidManifest.xml, and apktool.yml.

Is there something I am missing?
 
petsasj
Old
#3  
petsasj's Avatar
Recognized Developer
Thanks Meter 1565
Posts: 1,597
Join Date: Mar 2010
Location: Athens

 
DONATE TO ME
Quote:
Originally Posted by ctomgee View Post
This is driving me insane.

I cannot, for the life of me, get a smali folder when I decompile Phone.apk. I've tried using APKManager 4.9, and directly using APKTool.

Using APKManager, I set my project, decompile with dependencies, drag twframework-res.apk when asked.

Using APKTool, I type:
apktool d Phone.apk

Both methods, all I get are a res folder, AndroidManifest.xml, and apktool.yml.

Is there something I am missing?
Yeah, you're missing the fact that your ROM is probably odexed and not deodexed.
The Following User Says Thank You to petsasj For This Useful Post: [ Click to Expand ]
 
ctomgee
Old
(Last edited by ctomgee; 14th November 2011 at 08:15 PM.)
#4  
Senior Member
Thanks Meter 894
Posts: 3,540
Join Date: Dec 2010
Quote:
Originally Posted by petsasj View Post
Yeah, you're missing the fact that your ROM is probably odexed and not deodexed.
Such a simple answer... *sigh*

You are correct. So how can I edit the .smali file of an odexed Phone.apk?

EDIT: Nevermind... I supposed I can just find a deodexed Phone.apk to make the change on, yeah?
 
petsasj
Old
#5  
petsasj's Avatar
Recognized Developer
Thanks Meter 1565
Posts: 1,597
Join Date: Mar 2010
Location: Athens

 
DONATE TO ME
Quote:
Originally Posted by ctomgee View Post
Such a simple answer... *sigh*

You are correct. So how can I edit the .smali file of an odexed Phone.apk?

EDIT: Nevermind... I supposed I can just find a deodexed Phone.apk to make the change on, yeah?
Finding a deodexed Phone.apk is probably easiest fo you. I don't think you're accustomed to smali/baksmali deodexing procedures? There's a nice How-To by sicopat, but still, get a deodexed Phone.apk
The Following User Says Thank You to petsasj For This Useful Post: [ Click to Expand ]
 
ctomgee
Old
(Last edited by ctomgee; 14th November 2011 at 08:36 PM.)
#6  
Senior Member
Thanks Meter 894
Posts: 3,540
Join Date: Dec 2010
Quote:
Originally Posted by petsasj View Post
Finding a deodexed Phone.apk is probably easiest fo you. I don't think you're accustomed to smali/baksmali deodexing procedures? There's a nice How-To by sicopat, but still, get a deodexed Phone.apk
Just started learning about deodexing, yeah. I think I've found a deodexed Phone.apk for my ROM version, thanks for your help.
 
SignalX
Old
#7  
SignalX's Avatar
Senior Member
Thanks Meter 272
Posts: 1,164
Join Date: Jun 2011
Location: Darkness
thanks but what about MIUI and CM7 roms?
i have echo problem in these roms!

cheers,

SX
 
knightnz
Old
#8  
Senior Member
Thanks Meter 227
Posts: 1,522
Join Date: Dec 2009
Location: Wellington

 
DONATE TO ME
Quote:
Originally Posted by SignalX View Post
thanks but what about MIUI and CM7 roms?
i have echo problem in these roms!

cheers,

SX
Have you looked to see if that same line is in the file?
---

Spelling essentials:
1) There is NO SUCH WORD as "alot" - It's "a lot"
2) The shortened form of You are is You're - NOT Your
3) Loosing & Loose have completely different meanings to Losing & Lose.
The Following User Says Thank You to knightnz For This Useful Post: [ Click to Expand ]
 
yay1974
Old
#9  
yay1974's Avatar
Senior Member
Thanks Meter 21
Posts: 207
Join Date: Aug 2011
Thumbs up Anyone can confirm it really works?

Thank you for the solution but can anyone post deodexed phone.apk with this solution here (xxki4 or xwkj3)?
 
ctomgee
Old
#10  
Senior Member
Thanks Meter 894
Posts: 3,540
Join Date: Dec 2010
Quote:
Originally Posted by yay1974 View Post
Thank you for the solution but can anyone post deodexed phone.apk with this solution here (xxki4 or xwkj3)?
I can confirm that it DOES work. I was able to edit a deodexed Phone.apk from XXKI3, and now it defaults NR to being OFF during calls. (though, as drorsi states in the OP, it is still on for the first call after the phone boots). You still have the option of turning it on during the call if you wish.

You can find what you need to know on how to decompile/recompile .apk files at http://forum.xda-developers.com/showthread.php?t=695701.

 
Post Reply+
Tags
disable noise reduction, i9100
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...