[MOD][GUIDE] Enable ro.config.media_vol_steps Functionality in HiFi Mode - LG V20 Themes, Apps, and Mods

A little while ago I made this mod that lets you set a custom value to apply to all volume sliders. I found it pretty handy, but it got a little annoying how every slider was affected, and a lot would move extremely slowly because of their tiny scaling.
Well I'm back, this time with a slightly different mod. This one only affects the HiFi volume step count, but it does it in a standard way. You might know about the build.prop key AOSP uses (ro.config.media_vol_steps) to customize the number of volume steps allowed. For whatever reason, LG disabled this behavior for the media volume (laziness? who knows...), including HiFi. I figured out how to simultaneously make the HiFi steps be 1 and have LG actually listen to that build.prop value.
Right now, I have `ro.config.media_vol_steps=100` in my build.prop and can confirm the slider does actually have 100 steps now.
I'm attaching two JARs. The US version should work with most variants, while the 990DS version is for the H990 variants, assuming the US version doesn't work.
Do It Manually:
- As before, I'm not going to give instructions on decompiling JARs and ODEXes. You'll have to do that yourself.
- If you applied my previous mod, RESTORE YOUR BACKUP before proceeding!
- Decompile your services.jar and open the following file in a text editor (I use Sublime because it has a Smali highlighting plugin):
Code:
- com/android/server/audio/AudioService.smali
- Find the following block of code (it may not be exactly the same, so just search for the string you see at the top):
Code:
const-string/jumbo v2, "ro.config.media_vol_steps"
.line 743
sget-object v3, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v4, 0x3
aget v3, v3, v4
.line 742
invoke-static {v2, v3}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v13
.line 744
sget-object v2, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v3, 0x3
aget v2, v2, v3
if-eq v13, v2, :cond_1
.line 745
sget-object v2, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v3, 0x3
aput v13, v2, v3
.line 746
sget-object v2, Landroid/media/AudioSystem;->DEFAULT_STREAM_VOLUME:[I
mul-int/lit8 v3, v13, 0x3
div-int/lit8 v3, v3, 0x4
const/4 v4, 0x3
aput v3, v2, v4
.line 750
:cond_1
- At the bottom, right above .line ***, add this:
Code:
sget-object v3, Lcom/android/server/audio/AudioService;->MAX_STREAM_VOLUME:[I
const/4 v4, 0x3
aget v3, v3, v4
sput v3, Lcom/android/server/audio/AudioService;->MAX_MUSIC_STREAM_VOLUME:I
- About 24 lines or so down, look for this block:
Code:
if-eqz v2, :cond_2
.line 751
const/4 v2, 0x1
sput-boolean v2, Lcom/android/server/audio/AudioService;->mHifiDacSupported:Z
.line 752
const/4 v2, 0x5
sput v2, Lcom/android/server/audio/AudioService;->HIFI_MEDIA_VOLUME_OFFSET:I
.line 754
:cond_2
- At the bottom, you'll notice a const/4 v2 variable, with a value of 0x5. Change the value to 0x1.
- Recompile, copy in, set permissions, and it should be good to go.

@Zacharee1 working great, thanks! I do notice that now when the volume is raised to 11 that I get the warning about hearing damage... is it possible to change that to maybe 15 or 16?
also is it possible to also do this for Bluetooth? seems like it's either too loud or too low when I use with earbuds

@Zacharee1
Working good on my H990DS
I think H990DS uses a different approach..
When i replaced the service jar file.. I could see only 15 steps for Hifi Volume.
The behaviour is same for HIFI or without HIFI
When build.prop value is changed to 100
it now has 100 steps. with or without HIFI with 1 increment
Warning for high volume is triggers on 10

Screenshot added
Can some one confirm the stock value. For other sliders. I am just confused..
All other sliders have 15 steps right..?

I don't see ro.congig.media_vol_steps in build.prop
Sent from my LG-H990 using Tapatalk

Squadala said:
I don't see ro.congig.media_vol_steps in build.prop
Click to expand...
Click to collapse
You have to add this line
damonthegreat said:
dammit! even the h990ds jar makes my h990ds bootlop. is there any hope?
Click to expand...
Click to collapse
Is your system modified..?
DS service jar is based on 10g.
Can you confirm the stock volume steps for ringtone/notification is it 15.?

ahmedyar91 said:
Screenshot added
Can some one confirm the stock value. For other sliders. I am just confused..
All other sliders have 15 steps right..?
Click to expand...
Click to collapse
The HiFi slider is normally up to 75 with 5 increment steps. With this mod, the steps are 1 increment, so the default max becomes 15. If I force it to 75, ARISE breaks, and it might even be broken still. If it's broken anyway, I'll set the default to 75.

Zacharee1 said:
The HiFi slider is normally up to 75 with 5 increment steps. With this mod, the steps are 1 increment, so the default max becomes 15. If I force it to 75, ARISE breaks, and it might even be broken still. If it's broken anyway, I'll set the default to 75.
Click to expand...
Click to collapse
Its not a big deal though.
After changing in build.prop..
The slider has 100 value with 1 increment and thats perfectly fine..
But the problem here is that it changes the media slider (without HIFI) to 100 as well..

ahmedyar91 said:
Its not a big deal though.
After changing in build.prop..
The slider has 100 value with 1 increment and thats perfectly fine..
But the problem here is that it changes the media slider (without HIFI) to 100 as well..
Click to expand...
Click to collapse
That's intended.

Zacharee1 said:
This one only affects the HiFi volume step count, but it does it in a standard way.
Click to expand...
Click to collapse
May be I got confused because of this line..
BTW in your previous MOD the increment value without earphones was 5,
I think 1 incremental value for HIFI is perfect, but without earphones it should be 5.

ahmedyar91 said:
May be I got confused because of this line..
BTW in your previous MOD the increment value without earphones was 5,
I think 1 incremental value for HIFI is perfect, but without earphones it should be 5.
Click to expand...
Click to collapse
I don't think I can do that.

Zacharee1 said:
I don't think I can do that.
Click to expand...
Click to collapse
Its not an issue
Thanks a ton Zac..

Cheers, working excellent on a H990DS running latest v11i!

To disable the volume warning, use this command from a computer:
Code:
adb shell settings put global audio_safe_volume_state 1
1 means disabled.
2 means inactive.
3 means enabled.

damonthegreat said:
if you are refering to the line "ro.config.vc_call_vol_steps" then no, it's actually 7.
and how can you get 10g if you can't get past December 2016 firmware on a rooted h990ds?
Click to expand...
Click to collapse
Use KDZ writer to update to the latest firmware

ahmedyar91 said:
Use KDZ writer to update to the latest firmware
Click to expand...
Click to collapse
How? Step by step
Sent from my LG-H990 using Tapatalk
---------- Post added at 08:49 PM ---------- Previous post was at 08:40 PM ----------
ahmedyar91 said:
Use KDZ writer to update to the latest firmware
Click to expand...
Click to collapse
Do I need to update? Can't I just change it to 15?
Sent from my LG-H990 using Tapatalk

Squadala said:
How? Step by step
Click to expand...
Click to collapse
Go to KDZ writer thread.. There's a step by step guide..
Yes you should update.. The service jar based on the latest firmware

damonthegreat said:
i'm downloading the middle east 10g. is that good? would downloading from other regions mess up my phone?
---------- Post added at 10:08 PM ---------- Previous post was at 09:46 PM ----------
i'm using this guide but it's still confusing which command to use:
https://forum.xda-developers.com/v20/development/tool-kdz-writer-t3649818
any help?
Click to expand...
Click to collapse
You can use other region's firmware.. But its recommended to use your default region..
Yeah it is a little confusing..
Ask me I'll help

@Zacharee1 I just updated my US996 to 10n and noticed this mod now causes my device to reboot if I change my brightness to auto. would you be able to look into this? let me know what you need from me

Anyone using WakeBlock, update to the services.jar in the latest post of my Miscellaneous Mods threads ASAP!!!

Related

Remvove GPS icon in status bar

Using scotts clean rom 1.2 and was wondering of there was anything I could flash to remove that icon.
Sent from my Rezound using xda premium
nfrederick said:
Using scotts clean rom 1.2 and was wondering of there was anything I could flash to remove that icon.
Sent from my Rezound using xda premium
Click to expand...
Click to collapse
PM me.
do u know how to use apktool?
pm sent
never used apktool
EDIT
just downloaded and installed, looks like it runs using correctly when I type apktool in a command prompt.
thats as far as I got haha
I have a SystemUI.apk that has it removed, as well as all of the advanced settings...you'd have to adb push it or use root explorer/ES File Explorer to stick it in system/app.
Ironically, I'm trying to do the opposite and don't know how to re-enable it with this particular SysUI
Would you mind posting it?
awenthol said:
I have a SystemUI.apk that has it removed, as well as all of the advanced settings...you'd have to adb push it or use root explorer/ES File Explorer to stick it in system/app.
Ironically, I'm trying to do the opposite and don't know how to re-enable it with this particular SysUI
Click to expand...
Click to collapse
nfrederick said:
Would you mind posting it?
Click to expand...
Click to collapse
Hahah... I can help you both...
I was just about to post a mod that removed location.
awenthol you need to change two lines under gpsone
in HtcCdmaStatusBar.smali...
Look For:
Code:
.line 279
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HtcCdmaStatusBar;->mService:Landroid/app/StatusBarManager;
const-string v1, "gpsone"
const/4 v2, 0x0
Change to
Code:
.line 279
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HtcCdmaStatusBar;->mService:Landroid/app/StatusBarManager;
const-string v1, "gpsone"
[COLOR="Red"] const/4 v2, 0x1[/COLOR]
Then the second spot a few lines down is....
Code:
.method private updateMtGpsIcon()V
.locals 6
.prologue
const/4 v3, 0x3
const/4 v2, 0x0
Code:
.method private updateMtGpsIcon()V
.locals 6
.prologue
const/4 v3, 0x3
[COLOR="red"] const/4 v2, 0x1[/COLOR]
Oh and my next ROM will have the icon removed... And I will post a sep zip for it...
Ok, here is my mod: http://forum.xda-developers.com/showthread.php?p=21119197#post21119197
Thanks Scott, perfect timing! Haha.
I can't view the .xml files. I get some stuff at the top, but all I get for the rest of the document is yyyyy and random characters..
maximus20895 said:
I can't view the .xml files. I get some stuff at the top, but all I get for the rest of the document is yyyyy and random characters..
Click to expand...
Click to collapse
You need to decode them with apktool

[Dev]Enabling CRT-off Animation on Neo Stock ICS roms

We all know that there is no CRT-off mod for the Neo /V. This is because only changing the value of config_animateScreenLights from true to false in framework-res.apk is not working anymore!
The problem is that are some missing commands in the /system/framework/services.jar
After comparing files from GB and ICS, i might have come up with a Method.
This will require some devs to continue on my work, as i don't have the proper tools to work on.
Hands-on:
This is what have to be done:
First of all decompile classes of services.jar (I won't provide any information to this, there are many tutorials out there how to use the smali tools!)
Then in com/android/server/PowerManagerService.smali we have to make the method nativeStartSurfaceFlingerAnimation(I)V callable from inner classes. To do that, we have to add the following after the last access$XXXX method:
Code:
.method static synthetic access$9000(Lcom/android/server/PowerManagerService;I)V
.registers 2
.parameter "x0"
.parameter "x1"
.prologue
.line 110
invoke-direct {p0, p1}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)V
return-void
.end method
Than we have to add some commands to the file com/android/server/PowerManagerService$BrightnessState.smali to trigger the CRT-off-effect. For that add the red part between :cond_38 and iget-object v4, p0, Lcom/a.... like this (its around line 400 in code):
Code:
.line 2679
.restart local v3 #turningOff:Z
:cond_38
[COLOR="red"]iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/16 v3, 0x11 # CRT-On and CRT-Off
#calls: Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)
invoke-static {v4, v3}, Lcom/android/server/PowerManagerService;->access$9000(Lcom/android/server/PowerManagerService;I)V[/COLOR]
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightness:Lcom/android/server/PowerManagerService$BrightnessState;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$6000(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;
move-result-object v4
Lastly, recompile the file, put it on your phone CRT-off effect will be magically displayed.
Lastly, i really seek the devs help to work on this and bring success to this work
Wow that will be great when we have this on ICS
Write in my mobile
TheF3nix said:
Lastly, recompile the file, put it on your phone CRT-off effect will be magically displayed.
Click to expand...
Click to collapse
what do u mean by magically displayed? u made it to work or its still a work in progress?
jjdoctor said:
what do u mean by magically displayed? u made it to work or its still a work in progress?
Click to expand...
Click to collapse
Work in Progress? Just follow my steps. I haven't try it out yet. Not sure whether it will work
Sent from my MT11i using Tapatalk 2
TheF3nix said:
Work in Progress? Just follow my steps. I haven't try it out yet. Not sure whether it will work
Sent from my MT11i using Tapatalk 2
Click to expand...
Click to collapse
we need modified surfaceflinger.so and sufaceflingerclient.so to get it to work...
jjdoctor said:
we need modified surfaceflinger.so and sufaceflingerclient.so to get it to work...
Click to expand...
Click to collapse
Is anyone working on this anymore?
This would be a great mod to have again
Really waiting to have that on my Ray... CM Based ROM have this effect... So nice.... As I decompile CM ROM, animatescreenlights is set to TRUE. What I saw new is the config_screenOffAnimations, that line on bool.xml and not present on Stock ROMS I think (some?).
What if you compare the surfaceflinger and surfaceflingerclient from cm9 and stock roms, they can't be that different right?, maybe thats the way to go, to get this to work.
The latest cm 9.1 stable has CRT enabled....
Surely someone can now port this to stock ICS!!!!!!!!!!!!!!!!!

[HOW TO] [4.1.2] [LS8] Proper disable HOME BUTTON LAG (Apex support)(improved)

Hello xda'ers,
someone reading the title may say: but we still have no home button lag!
You could link me Oliwe's mod but this is a different thing.
His fix or mod consist to disable mHomeKeyDoubleClickConcept launching directly launchHomeFromHotKey()V method.
Nothing bad until you hate to have double click feature to launch vlingo (or voice commands).
If you want NO LAG and keep the double click feature?
Now there s a real fix to the home button lag, no workaround, no disabling samsung features! :victory:
We need to place a single line into a .smali file inside our android.policy.jar called PhoneWindowManager.smali.
This mod it s really simple to do, there s no :cond_xx to replace, add or remove.
Simply add green part
JELLY BEAN LS8
Code:
.line 3267
.end local v38 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_304
:goto_304
const/16 v46, 0x0
move/from16 v0, v46
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[COLOR="DarkGreen"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR]
Now we launch home before double click is recognized, but.. we re doing this twice, so we need to delete the second launch.
In fact if we take a look at PhoneWindowManager$HomeKeyDoubleClickConcept.smali we can see, at the end of singleClickJob()V method (red lines)
Code:
[COLOR="Red"]if-eqz v7, :cond_93[/COLOR]
const-string v7, "HomeKeyDoubleClick"
const-string v8, " in singleClickJob(), mSentHomeDownToApp is false. Now call launchHomeFromHotKey()"
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 8201
[COLOR="Red"] :cond_93
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-virtual {v7}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
[/COLOR] goto :goto_48
.line 8203
:cond_99
iget-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->DEBUG:Z
if-eqz v7, :cond_48
const-string v7, "HomeKeyDoubleClick"
const-string v8, " in singleClickJob(), mSentHomeDownToApp is true. now set mSentHomeDownToApp to false and do nothing."
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_48
.end method
that we re launching again "launchhomefromhotkey" method, so we need to delete the red lines.
This will fix home button lag, won t let u return on default homescreen (but u will get the homescreen u were before) and no more problem with apex or other non touchwiz launchers.
it s so easy that maybe samsung someday will implement it this way lol
that s all.
Easy to do
recompile and enjoy your no lag home button with double click feature.
need a zip? Send me your android.policy.jar or request this mod to your rom maker.
ICS
Search: .line 2232, you will get:
Code:
.line 2232
:cond_207
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
move/from16 v39, v0
if-eqz v39, :cond_2b3
if-nez v8, :cond_2b3
.line 2233
const/16 v39, 0x0
move/from16 v0, v39
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
at the end of this code add:
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
So it will looks like this:
Code:
.line 2232
:cond_207
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
move/from16 v39, v0
if-eqz v39, :cond_2b3
if-nez v8, :cond_2b3
.line 2233
const/16 v39, 0x0
move/from16 v0, v39
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
that s all.
Easy to do
recompile and enjoy your no lag homebutton with double click feature.
Awesome
Sent from my S II ( "Jelly Bean'd Monster" )
As always, great job Mirko :good:
Hi, This method is successful for Lockscreen Home button lag on Stock rom 4,04 ?
Nasty_z said:
Awesome
Sent from my S II ( "Jelly Bean'd Monster" )
Click to expand...
Click to collapse
Thanks
salesale said:
As always, great job Mirko :good:
Click to expand...
Click to collapse
thx mate, did u try?
pnhsp said:
Hi, This method is successful for Lockscreen Home button lag on Stock rom 4,04 ?
Click to expand...
Click to collapse
What u mean?
Inviato dal mio GT-I9100 con Tapatalk 2
Great job as always mirko. :good:
I was wondering if u could write a similar guide on creating expandable volume controls. Saw it in the github sometimes ago. I tried comparing files to no result.
kamdev said:
Great job as always mirko. :good:
I was wondering if u could write a similar guide on creating expandable volume controls. Saw it in the github sometimes ago. I tried comparing files to no result.
Click to expand...
Click to collapse
yup, it s pretty hard to compare expandable volume controls, there are lots of diffs.
I will look into a simpler way, and maybe posting the how to, but i l need time.
So.. This requires a deodexed ROM. huh?
Hi folks,
Can someone modify my android.policy.jar ? (attached file)
The home button lag makes me sick
I've tried but I was unable to find the required file to modify it.
Thanks in advance
KcLKcL said:
So.. This requires a deodexed ROM. huh?
Click to expand...
Click to collapse
sure
dany__ said:
Hi folks,
Can someone modify my android.policy.jar ? (attached file)
The home button lag makes me sick
I've tried but I was unable to find the required file to modify it.
Thanks in advance
Click to expand...
Click to collapse
thread is for devs or people who can use tools and for help
No requests please
tutorial updated to jelly bean leak LSJ
There is a built in setting in jb leak in the voice command app to disable the double home button press.
Sent from my GT-I9100 using Tapatalk 2
hikarugo said:
There is a built in setting in jb leak in the voice command app to disable the double home button press.
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
Hello hikarugo. I don t wanna disable voice command, i wanna disable the lag xD.
Have both, that s the mod
Hi Mirko, thanks for the guide, but there is a different behavior at least in MIUI ICS if I use your guide.
Lets assume there is 3 home screen pages and the second one is set to home screen. If I start an app from the first screen page and then pressing home button, it will go to the second page instead staying in the current page which is the first page.
The only thing to make stay on the current page is to remove the "PhoneWindowManager$HomeKeyDoubleClickConcept;->addAction(IIZ)V" like in the Oliwe guide.
If you have another workaround, I'll be appreciate it. Thanks.
mirko are you going to relase a new rom or what?
fusionjack said:
Hi Mirko, thanks for the guide, but there is a different behavior at least in MIUI ICS if I use your guide.
Lets assume there is 3 home screen pages and the second one is set to home screen. If I start an app from the first screen page and then pressing home button, it will go to the second page instead staying in the current page which is the first page.
The only thing to make stay on the current page is to remove the "PhoneWindowManager$HomeKeyDoubleClickConcept;->addAction(IIZ)V" like in the Oliwe guide.
If you have another workaround, I'll be appreciate it. Thanks.
Click to expand...
Click to collapse
yes buddy, same behaviour here too.
but i really prefer to back in my homescreen soon and preserve a samsung feature instead of disabling voice command (erasing that line u will erase the feature), and wouldn t be any reason to make a tutorial after Oliwe's one, right?
anyway, if u are on miui there s no reason to use this tutorial, since miui shouldn t have doubleclick feature, or am i missing something? (i m not a miui user )
reply back
malavan said:
mirko are you going to relase a new rom or what?
Click to expand...
Click to collapse
hello mal
sincerely i thought to make it with legendk95 as before, but in the last times we re going wrong.. so i don t know, probably yes.
Mirko ddd said:
yes buddy, same behaviour here too.
but i really prefer to back in my homescreen soon and preserve a samsung feature instead of disabling voice command (erasing that line u will erase the feature), and wouldn t be any reason to make a tutorial after Oliwe's one, right?
anyway, if u are on miui there s no reason to use this tutorial, since miui shouldn t have doubleclick feature, or am i missing something? (i m not a miui user )
reply back
Click to expand...
Click to collapse
LOL..sure.
MIUI basically is using manufacture ROM for each device, so I see similar code in MIUI and yes, it has also lag by pressing home button.
I never use voice command, therefore I don't know if MIUI for Galaxy S2 really supports this double-click feature.
fusionjack said:
LOL..sure.
MIUI basically is using manufacture ROM for each device, so I see similar code in MIUI and yes, it has also lag by pressing home button.
I never use voice command, therefore I don't know if MIUI for Galaxy S2 really supports this double-click feature.
Click to expand...
Click to collapse
lol!! so disable directly the doubletap feature following Oliwe's tutorial
mh i gotta update the code, i made it wrong lol

[MOD] Custom Volume Step Count for Everything

So I've always been annoyed with how the HiFi volume only has 15 steps. For me, 5 is too low and 10 is too loud (cheap earbuds). With the release of the V30, I've learned that it has 75 steps for the HiFi volume, which prompted me to modify our system to get 75 steps as well.
Well, I didn't do that exactly, but I think this is better. I didn't manage to get the 75 steps on just the HiFi volume: I changed every slider, and it's customizable. By default, it's 1 step on the HiFi slider. This is about 1/2 of a step on the ringer volume I think. But if you don't like that, you can change what it uses.
The property is
Code:
volume_step_size
in Settings.Global.
You can set that using ADB. For instance, if you want to go back to the default step size for HiFi mode, you could use
Code:
adb shell settings put global volume_step_size 10
The default step size if 5, but for whatever reason, the system uses double the number you want. It's some weird scaling thing I think.
Attached is the modified services.jar. It goes in /system/framework/ with 0644 permissions.
Enjoy!
Do it Manually
This guide assumes you know how to decompile and recompile APKs/JARs or DEX files. I'm just going to tell you what code you need to edit to add this mod yourself.
- Decompile your services.jar. If you're on an odexed system, you'll either have to deodex the JAR or edit the DEX. That's beyond the scope of this though.
- Find these two files:
Code:
- /com/android/server/audio/AudioService.smali
- /com/android/server/audio/AudioService$VolumeStreamState.smali
- In AudioService, you need to add two new methods.
Code:
.method static synthetic -get49(Lcom/android/server/audio/AudioService;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/server/audio/AudioService;->mHifiDacMode:Z
return v0
.end method
You'll want to make sure that -get49 isn't already used as a method name. My latest method was -get48, so the one I added I renamed to -get49.
Code:
.method private getCustomVolumeStepValue()I
.locals 3
const-string/jumbo v0, "volume_step_size"
const v1, 0x2
iget-object v2, p0, Lcom/android/server/audio/AudioService;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
invoke-static {v2, v0, v1}, Landroid/provider/Settings$Global;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
return v2
.end method
This is the method that grabs the current volume step set in Settings.Global. If there's no value found, it will use "2" by default.
- Now, go into AudioService$VolumeStreamState and find this method: "rescaleDeltaIndex(IIII)I." Comment the entire method out and paste this instead:
Code:
.method private rescaleDeltaIndex(IIII)I
.locals 3
.param p1, "deltaIndex" # I
.param p2, "flags" # I
.param p3, "streamType" # I
.param p4, "device" # I
.prologue
.line 4948
invoke-static {}, Lcom/android/server/audio/AudioService;->-get26()Z
move-result v2
if-eqz v2, :cond_4
const/high16 v2, 0x20000
and-int/2addr v2, p2
if-nez v2, :cond_4
const/4 v2, 0x3
if-ne p3, v2, :cond_4
.line 4950
iget-object v2, p0, Lcom/android/server/audio/AudioService$VolumeStreamState;->this$0:Lcom/android/server/audio/AudioService;
invoke-static {v2}, Lcom/android/server/audio/AudioService;->-get49(Lcom/android/server/audio/AudioService;)Z
move-result v2
if-eqz v2, :cond_0
and-int/lit16 v2, p2, 0x1000
if-nez v2, :cond_1
.line 4951
:cond_0
invoke-static {}, Lcom/android/server/audio/AudioService;->-get0()I
move-result v2
mul-int/2addr p1, v2
.line 4953
:cond_1
const/4 v1, 0x0
.line 4954
.local v1, "rescaledeltaIndex":I
invoke-virtual {p0, p4}, Lcom/android/server/audio/AudioService$VolumeStreamState;->getIndex(I)I
move-result v0
.line 4955
.local v0, "currentIndex":I
rem-int v2, v0, p1
if-eqz v2, :cond_3
.line 4956
if-gtz p1, :cond_2
.line 4957
rem-int v2, v0, p1
neg-int v1, v2
.line 4964
:goto_0
return v1
.line 4959
:cond_2
rem-int v2, v0, p1
sub-int v1, p1, v2
goto :goto_0
.line 4962
:cond_3
move v1, p1
goto :goto_0
.line 4966
.end local v0 # "currentIndex":I
.end local v1 # "rescaledeltaIndex":I
:cond_4
return p1
.end method
-get49 is the method you pasted earlier.
-get0 is the method that returns HIFI_MEDIA_VOLUME_OFFSET. Just make sure your -get0 is the same one as mine.
- Now, you need to actually get the custom method you pasted to be called. Find "adjustStreamVolume(IIILjava/lang/String;Ljava/lang/String;I)V" in AudioService and find the call to "rescaleIndex(III)I" inside it.
My call looks like this:
Code:
invoke-direct {v0, v6, v1, v13}, Lcom/android/server/audio/AudioService;->rescaleIndex(III)I
Change whatever you have to look like this:
Code:
invoke-direct {v0}, Lcom/android/server/audio/AudioService;->getCustomVolumeStepValue()I
- Rebuild and install!
Do I remove an old file first or just set this one in there
THANKS!!
The big step sizes have bothered me a lot!
If I want to use the adb command to set step sizes of 1, should I use 2?
Edit: File works for me!
Cheers
Emil
I've been looking for something like this. Thank you! ?
---------- Post added at 02:23 PM ---------- Previous post was at 02:22 PM ----------
shadavis08 said:
Do I remove an old file first or just set this one in there
Click to expand...
Click to collapse
I added .bak to the end of the original file so its still there in case I need it.
I changed the file and softrebooted. Not working.
Am I doing something wrong?
Salvaparalyzer said:
I changed the file and softrebooted. Not working.
Am I doing something wrong?
Click to expand...
Click to collapse
Did you change the permissions?
I would do a full reboot. A soft boot may not be enough.
Sent from my LG-H918 using Tapatalk
Salvaparalyzer said:
I changed the file and softrebooted. Not working.
Am I doing something wrong?
Click to expand...
Click to collapse
Are you sure it isn't working? Did you put it in the right place?
A little off-topic, but do you have any idea if something similar can be done for the brightness slider? Basically I would like to be able to set it to stick to increments of 5% or 10% when adjusting. Is there a similar setting I can change using ADB?
RichBordoni said:
A little off-topic, but do you have any idea if something similar can be done for the brightness slider? Basically I would like to be able to set it to stick to increments of 5% or 10% when adjusting. Is there a similar setting I can change using ADB?
Click to expand...
Click to collapse
Every time I fiddle with brightness something bootloops.
Zacharee1 said:
Are you sure it isn't working? Did you put it in the right place?
Click to expand...
Click to collapse
Permission are also correct I think
Update: Hmm, my phone soft restarts with incoming or out coming calls with this mod, fixed it by restoring my original file.
Just a heads up! Backup your old file.
H990DS V11i-GLOBAL-COM(flashed V10j Indonesia from V10g SEA)
3mL said:
Update: Hmm, my phone soft restarts with incoming or out coming calls with this mod, fixed it by restoring my original file.
Just a heads up! Backup your old file.
H990DS V11i-GLOBAL-COM(flashed V10j Indonesia from V10g SEA)
Click to expand...
Click to collapse
Weird, it doesn't happen here. The 990DS seems to always have problems with universal mods though.
Zacharee1 said:
Weird, it doesn't happen here. The 990DS seems to always have problems with universal mods though.
Click to expand...
Click to collapse
Yea, it's unfortunate.
Would you mind telling me what file you edited in the .dex file?
Perhaps it would work by editing my original file.
3mL said:
Yea, it's unfortunate.
Would you mind telling me what file you edited in the .dex file?
Perhaps it would work by editing my original file.
Click to expand...
Click to collapse
I'll write up a guide in a few hours. It involves editing Smali and all that.
Not only that. Phone reboots when trying to make a call with your file.
Restored the old file and the problem was gone.
H990ds here
3mL said:
Yea, it's unfortunate.
Would you mind telling me what file you edited in the .dex file?
Perhaps it would work by editing my original file.
Click to expand...
Click to collapse
Guide up.
Zacharee1 said:
Guide up.
Click to expand...
Click to collapse
Cheers! I'll have a look at it tomorrow.
Thanks Zach for the nice work.
I'm on OvrDrive's rom, h918, 10j. I believe it is odexed because the OP doesn't say anything about deodex.
I renamed the current services.jar, put yours in and set permissions. Rebooted and couldn't get past the LG logo.
Should your file work on this setup, or do I have to do it manually as you outlined?
androiddiego said:
Thanks Zach for the nice work.
I'm on OvrDrive's rom, h918, 10j. I believe it is odexed because the OP doesn't say anything about deodex.
I renamed the current services.jar, put yours in and set permissions. Rebooted and couldn't get past the LG logo.
Should your file work on this setup, or do I have to do it manually as you outlined?
Click to expand...
Click to collapse
I'm pretty sure this JAR is from OvrDriVE's 10J ROM so it should work fine.
Zacharee1 said:
I'm pretty sure this JAR is from OvrDriVE's 10J ROM so it should work fine.
Click to expand...
Click to collapse
Thanks! I'll try it again.

[MOD] Enable Double Press Power for Camera on stock ROM

This will enable the double press power for camera gesture on the stock ROM. On MiFavor 5.0 this will only work when the screen is on due to some zte service preventing it from working when screen is off (not surprised).
Decompile Settings_ZTE and open res/xml/display_settings.xml
Change
Code:
<SwitchPreference android:title="@string/camera_gesture_title" android:key="camera_gesture" android:summary="@string/camera_gesture_desc" />
to
Code:
<SwitchPreference android:title="@string/camera_double_tap_power_gesture_title" android:key="camera_double_tap_power_gesture" android:summary="@string/camera_double_tap_power_gesture_desc" />
Open smali/com/android/settings/DisplaySettings.smali
Go to
Code:
.method private updateState()V
Everywhere you see
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mCameraGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
Change to
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
Change
Code:
const-string/jumbo v6, "camera_gesture_disabled"
to
Code:
const-string/jumbo v6, "camera_double_tap_power_gesture_disabled"
Go to
Code:
.method public onCreate(Landroid/os/Bundle;)V
Change
Code:
const-string/jumbo v6, "camera_double_tap_power_gesture"
invoke-virtual {p0, v6}, Lcom/android/settings/DisplaySettings;->removePreference(Ljava/lang/String;)V
to
Code:
const-string/jumbo v6, "camera_double_tap_power_gesture"
invoke-virtual {p0, v6}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Lcom/zte/mifavor/support/v7/preference/Preference;
move-result-object v6
check-cast v6, Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
iput-object v6, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
iget-object v6, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
invoke-virtual {v6, p0}, Lcom/zte/mifavor/support/v7/preference/SwitchPreference;->setOnPreferenceChangeListener(Lcom/zte/mifavor/support/v7/preference/Preference$OnPreferenceChangeListener;)V
For MiFavor 5.0 use v0 instead of p0.
Go to
Code:
.method public onPreferenceChange(Lcom/zte/mifavor/support/v7/preference/Preference;Ljava/lang/Object;)Z
Change
Code:
iget-object v8, p0, Lcom/android/settings/DisplaySettings;->mCameraGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
to
Code:
iget-object v8, p0, Lcom/android/settings/DisplaySettings;->mCameraDoubleTapPowerGesturePreference:Lcom/zte/mifavor/support/v7/preference/SwitchPreference;
Change
Code:
const-string/jumbo v11, "camera_gesture_disabled"
to
Code:
const-string/jumbo v11, "camera_double_tap_power_gesture_disabled"
You may need to change the register numbers (v#) based on the surrounding code.
Recompile Settings_ZTE.
Huge thanks to @raystef66 for testing for me.
Can you make this steps for B32?
WesTD said:
Can you make this steps for B32?
Click to expand...
Click to collapse
This should work for any variant and any build
bkores said:
This should work for any variant and any build
Click to expand...
Click to collapse
I've couldn't get 3rd step. what should be new line?
WesTD said:
I've couldn't get 3rd step. what should be new line?
Click to expand...
Click to collapse
Code:
<item type="integer" name="zte_config_screenBrightnessDoze">17</item>
Doesn't work. No ambient display
WesTD said:
Doesn't work. No ambient display
Click to expand...
Click to collapse
Does it show up in settings or it just doesn't work?
Check to the OP and make sure you changed all the values. I added one that I forgot.
bkores said:
Does it show up in settings or it just doesn't work?
Check to the OP and make sure you changed all the values. I added one that I forgot.
Click to expand...
Click to collapse
No in settings
WesTD said:
No in settings
Click to expand...
Click to collapse
Did you make sure you modified all the values in the OP? Like I said I added one I forgot.
If you did try removing the following from Settings_ZTE/smali/com/android/settings/DisplaySettings.smali
Code:
.line 594
invoke-static {v2}, Lcom/android/settings/zte/MFVSysResource;->getResId(I)I
move-result v2
bkores said:
Did you make sure you modified all the values in the OP? Like I said I added one I forgot.
If you did try removing the following from Settings_ZTE/smali/com/android/settings/DisplaySettings.smali
Click to expand...
Click to collapse
Did you try and worked on b32?
BTW, I've make all steps
WesTD said:
Did you try and worked on b32?
BTW, I've make all steps
Click to expand...
Click to collapse
No I didn't try it because I just assumed it would work since those modifications have worked on every ROM I've used them on. But of course ZTE messed something up, as usual.
@WesTD I updated the OP with a new method that should work.
So this requires a root?
could you send us the modificated apk?
so we could replace it manually without decompiling and compiling the apk since i dont know how to do it.
Better yet, maybe teach a man to fish.. I wouldn't mind learning this
JackTheBest said:
could you send us the modificated apk?
so we could replace it manually without decompiling and compiling the apk since i dont know how to do it.
Click to expand...
Click to collapse
I'm sorry but I will not as the point is to do it yourself.
bkores said:
I'm sorry but I will not as the point is to do it yourself.
Click to expand...
Click to collapse
Could you at least tell us what tools we should use?
And what compiler you used since there's more than just one.
JackTheBest said:
Could you at least tell us what tools we should use?
And what compiler you used since there's more than just one.
Click to expand...
Click to collapse
I used APKTool and oat2dex. I'll write a guide on using these tools in general to modify apks on the Axon 7.
@JackTheBest I made a guide here: https://forum.xda-developers.com/axon-7/how-to/guide-modifying-apk-jar-files-axon-7-t3697945
Sorry guys I updated the OP with an extra step that I forgot. ZTE really went to extreme lengths to disable this function. Instead of just removing the one line in the display_settings.xml file they chose to disable it in the code itself. ZTE really needs better engineers because this is pissing me off.
My rant of the day

Categories

Resources