msm8660: Fix crash in Audio Policy Service

* HAL missing isStreamActiveRemotely causing crash
* Now routes to audio policy manager

Change-Id: I352f1a0bfe0c37a3f4520d66e24682a5f8e3e196
audio-caf: Trigger immediate doRouting() on setMode() change to normal

On call hangup, this normally happens as consequence of
a setParameter call shortly after the change of mode.
However, if a stream write occurs between the mode change
and setParameter, AudioStreamOutALSA::write calls route()
which then laters causes doRouting() not to deroute voice
properly.

By triggering an immediate doRouting() on a setMode change
to normal, we remove this window of opportunity for voice
derouting to fail.

Resolves calls with mute audio on jf.  This could
theoretically show up on other platforms if the
timing conditions are right.

Change-Id: I90e98596dcb42a0b4b164fc27790c39349ea777c
aacenc: Shut your facehole!

Change-Id: I962f6d99449868187d95b86c3a6672f098de5923
msm8660: add missing get_supported_devices in HW HAL

Change-Id: I1198bb8ca7c8c3c31eaf0af2a2e8a6761392bdd3
Merge "msm8660: Fix crash in Audio Policy Service" into cm-10.2
msm8660: use new API for devices

Change-Id: Icdebb576e0832e360a4de26e9af8cdcc9745e865
mm-audio: Make visible to all relevant chipsets

Change-Id: Iedc57cb60056e8af5b4d60c9f7cea50f16b2d9c3
alsa_sound: Additional updates for MR2

Change-Id: I32b5c69be594d4e46f8d3040500f4cd0a31895db
alsa_sound: Add support for sound card in Galaxy S4 Mini

Change-Id: I9ff14fa6cc1b1a0c5b2307f4f84dc42b378ae8c9
msm8660: use policy manager from ALSA

Change-Id: I94db1a64072e94f3d85dd0fcf15565f3dd673104
msm7627a/msm8660: Port heap mask change to ion

Heap mask field passes as argument at allocation
time to specify ion heap.

Change-Id: I9b77a8bb926d938b3cc023b0de2e3ab49455155a
audio/msm8660: Add support for Tunnel Playback.

Add a new audiosession to support Tunnel playback.

Change-Id: Ic3663037f5c62b23a8a448ed5a57f9f4de5c3231
audio/msm8660: Fix for pause and resume failure.

- Resume fails if the sequence is pause,flush & resume.
- Resume of audio HAL is not resulting in driver resume.
- When the music player is paused, seek and resume fail
  this is due to the functionality built around 'mseeking',
  fix is to remove the variable

Change-Id: I2e0901dd17e86ec29435847f2ac08c761e4c4512
msm8660: Update audio policy

 * Remove hack on VOIP device
 * Set A2DP samplerate to 48KHz

Change-Id: I52f0ebe341847a9603594920bef5e71f4325fbbe
msm8660: Use a larger sample buffer for LPA

Change-Id: I292b30ae2df64297b4585181bfcd06f231430b01
msm8660: Add latency support for LPA

-Audio loss for few seconds on headset connection.
-Stream is unmute in checkDeviceMuteStrategies before device switch
occurs.
-Increase delay in tempMute to ensure unmuting happens after device
switch happens. Also change latency for LPA to correct value similar
to that of hpcm.

Change-Id: I539a4726f6b9d53bbfdc5f92a8801d5f14c360eb
CRs-Fixed: 448355
audio/msm8660: Change default audio sample rate

Return Host PCM interface sample rate based on
AF resampler quality value.

(cherry picked from commit fbaba9b736d0b77c989c80946ffb7d105641c07d)

Change-Id: I204f423051d97be5ff4dfa9805406eca61a25966
audio/msm7627a: Fix for event thread not exiting

-Event thread never exits after lpa playback.
-In error case of GET_EVENT, it is checked against wrong
condition which is always false.
-Update the check condition to avoid such issues.

Change-Id: I8274a67791ba7656eb4031952ddc55ac919df60d
msm8660: Fix routing for all AudioSessionOut types

 * Pass the new output device around so that we're not always just using
   the one in the base class. This was preventing proper routing for
   all output streams.

Change-Id: I9019d46b1268a05c6c743e40e9198b6b4898b0de
audio/msm8660: Fix for voice call mute during voip

-Voice tx is muted when call is received while voip is active.
-After voice call is received, voip moves to standby and calls
setupDeviceforVoipCall with value as false. This will mute mic
during voice call.
-Return from setupDeviceforVoipCall without moving to normal mode
if called while in call.

Change-Id: I3dcd6dacd0d8b1242019e55d9d9be6909444e49d
CRs-Fixed: 451202