[Android Software/Hacking General [Developers Only]] abex181:
Having updated to Jelly Bean (CM10) and finding, to my dismay, the inflexibility that Google has introduced by linking System and Ringer volumes, I decided to do something about it. Hours of searching later....yielded no results except for others with similar gripes. :confused:

To be sure, this guide is not about unlinking Ringer and Notification volumes; CM10 already has an option for that. Not too sure about other AOSP-based ROMs or OEM skinned favours of Jelly Bean. I can only report my own experiences.

WHY?

Say for instance, you want your ringtone to be suitably loud...without your keypress/keyboard feedback sound/camera shutter/Google Now bleeps and bloops being equally loud. This is my use case, at least. I use AudioManager to adjust the System volume since it doesn't have a slider in the system settings.

HOW

Enough storytime, let's get down to business:

You need:

framework.jar from deodexed ROM

some form of archiving software to extract classes.dex from framework.jar

smali/baksmali tool to disassemble classes.dex

notepad software to make edits (I prefer Notepad++)

You also need read-write access to /system, i.e. the ability push/pull files from /system

Steps:

pull /system/framework/framework.jar from your ROM

extract classes.dex from framework.jar using archiving software (e.g. 7zip, winrar, windows explorer)

run the baksmali tool on classes.dex (details can be found using a google search)

find and open /android/media/AudioService.smali from the disassembled classes.dex

search for STREAM_VOLUME_ALIAS

above that line, you should see something like, "fill-array-data.... array_xxx", where xxx refers to the array that is being called

search for "array_xxx", you should find a block of "0x0t 0x0t 0x0t 0x0t" etc.

Notice how this is similar to the increased audio steps mod (the relevant array is nearby); this mod works just fine with it.

See the code example for the line that you want to change

save AudioService.smali

reassemble classes.dex using smali

replace classes.dex in framework.jar with your modified version

push the modified framework.jar to /system/framework/ or otherwise copy & replace it there (you may have to do this in recovery or else risk forcing a reboot)

set permissions (rw-r--r-- or 644)

reboot / wipe dalvik cache

Search for STREAM_VOLUME_ALIAS:

.line 240
const/16 v0, 0xa

new-array v0, v0, [I

fill-array-data v0, :[COLOR="Red"]array_2ec[/COLOR]

iput-object v0, p0, Landroid/media/AudioService;->STREAM_VOLUME_ALIAS:[I

Search for array_xxx (above, it is 2ec); comments added for clarity:

.line 240
:array_2ec
.array-data 0x4
0x0t 0x0t 0x0t 0x0t	//Voice Call
[COLOR="Red"] 0x2t[/COLOR] 0x0t 0x0t 0x0t	//System
0x2t 0x0t 0x0t 0x0t	//Ringer
0x3t 0x0t 0x0t 0x0t	//Media
0x4t 0x0t 0x0t 0x0t	//Alarm
0x2t 0x0t 0x0t 0x0t	//Notification
0x6t 0x0t 0x0t 0x0t	//Bluetooth
[COLOR="Red"] 0x2t[/COLOR] 0x0t 0x0t 0x0t	//System Enforced
0x2t 0x0t 0x0t 0x0t	//DTMF
0x3t 0x0t 0x0t 0x0t	//TTS
.end array-data

Change the value of 0x2t for System and System Enforced to 0x1t:

.array-data 0x4
0x0t 0x0t 0x0t 0x0t	//Voice Call
[COLOR="Red"] 0x1t[/COLOR] 0x0t 0x0t 0x0t	//System
0x2t 0x0t 0x0t 0x0t	//Ringer
0x3t 0x0t 0x0t 0x0t	//Media
0x4t 0x0t 0x0t 0x0t	//Alarm
0x2t 0x0t 0x0t 0x0t	//Notification
0x6t 0x0t 0x0t 0x0t	//Bluetooth
[COLOR="Red"]0x1t[/COLOR] 0x0t 0x0t 0x0t	//System Enforced
0x2t 0x0t 0x0t 0x0t	//DTMF
0x3t 0x0t 0x0t 0x0t	//TTS
.end array-data

Remarks

So far I've only tested this on my HTC OneXL running JellyBam-121412-nightly (CM10-based, with AOKP rom control and PA). However, since it is a framework.jar edit, it should be applicable to most Android phones. Ice Cream Sandwich phones did not have this problem (to the best of my knowledge). Please test and report if you do!

Only attempt if you've read this whole post and understand the steps. This will be done at your own risk, I am not responsible for and damages/bricking that is induced by your step through of this process or the edits themselves. I haven't experienced any issues at least.

I can post pictures of the process or a demonstration of it working if necessary, and when I have enough posts. (but I have exams currently..)

If any clarification is needed, just ask. (but again, I should be studying..)