Framework: Audio service - add missing pieces from CM9 port

Author: Phil Tunstall
Fix ring/notification volume not restoring correctly on headset (dis)connect

We weren't checking the alias of each stream when restoring, which meant that
for the notification stream volume:
1. The wrong volume level would be stored.
2. The volume level to restore would be retrieved from the wrong place, and then
overwrite the correctly restored ring stream volume.

As well as fixing that I have improved the readability of the code a bit.

 + Change-Id: I95234c2b7ad7dfd4dbd455a56c8a69975c514b50

Author:  Phil Tunstall
Sound preference: Safe volume restore when plugging in a headset (1/2)
When enabled, volumes that were above a threshold (~55%) the previous time
something was connected to the audio jack will be restored to that threshold
rather than their full level.

Affects all sound streams apart from voice call audio.

 + Change-Id: I0007a09ce75b55c95986e38a4cbb24fe4e8200a9

Author: dalingrin
Add separate headset and speaker volumes
This is a simple implementation of keeping separate volume
settings for the wired headset and the speaker without
overhauling the audio system.

This allows a person with sensitive headphones to keep music, ringer
and other stream volumes lower than they would usually keep the
speaker volumes.

 + Change-Id: Ia614c1e3ac548ff4e0104a090cda13b9daef09cb

Author: gsarrica
Allow unlinking of notification sound and ringtone volume.
Thanks to http://forum.aokp.co/ for this.

 + Change-Id: I55db003cc1691fbca5d3e8ea79e088d0622d38ee

Settings side has been merged

Change-Id: Ie48323951c8e2e7578a2aa877cf3ed516a950091
frameworks/base: Remove CM headset/speaker volume restore code
- Jelly Bean already has this built in for the media volume stream, but it's
broken by having our own code in there as well.
Other audio streams will no longer have their volume levels restored, and only
media volume will be subjected to the 'safe headset volume restore' cap.

- Cleaned up the 'link notification with ringtone volume' code.

Change-Id: I7011658aa4e1343b9f5f61a5952a1fbc9e470588