Audio-CAF: Squash fixes from Code Aurora Forum

audio: enabled SSR in HAL

- Enable surround sound recording in HAL

Change-Id: Ibcbda82166240d613e4302488580cfdb55827d1b

Conflicts:

	alsa_sound/Android.mk

audio: fix for audio recording

- Read SSR system prop only for surround
  sound recording use case.
- Change input buffer size for 8974 to 512 bytes

Change-Id: I70064769e92149cb6675a92018fb35533900e65f

audio: update device for all outputs in setPhoneState

- Change routing for all outputs is nessary in setPhoneState
  Update devices not only for primary outputs but also other
  outputs including direct, tunnel, HDMI and so on

Change-Id: I4861e67c8aab9e39f83386c27b9a9e167befd347
CRs-Fixed: 438651

alsa-sound: AudioSessionOut synchronization fixes

- Modify synchronization between AudioSink and EventThread
- Move the code block related to drain to a different function
- Reset EOS flags in write()
- Do not depend on the filled queue size to set mReachedEOS

Change-Id: Ie8cd7b9ff9cab495f236f2cfa9c68a9f3a204fe4
CRs-Fixed: 439892

alsa-sound : Fix a deadlock

- openOutputStream() deletes an object of type AudioSessionOut
  if the object initialization fails.
- This leads to a deadlock as the AudioSessionOut::reset() tries
  to acquire the same lock held by openOutputStream.
- Release the lock in openOutputStream before deleting the
  AudioSessionOut object.

Change-Id: If763eded702a59828ae51adfa4dca23749bd7300
CRs-Fixed: 442365

AudioSessionOut: Fix to handle a single write() with an empty buffer

- This fix is a workaround to exit cleanly in the case where the AudioSink
  write might give just a single zero length buffer to the driver.

Change-Id: I68d023e6f0bd5b5e4f593a42b26c685e3405288b
CRs-Fixed: 445182

alsa-sound: Adjustment for tunnel mode buffer size

- Make necessary adjustments to align the buffer size
  for tunnel mode playback to satisfy the following condition
- Buffer size is a multiple of LCM(1,2,4,6,8)
- Buffer size is aligned to 4k.
CRs-Fixed: 447274, 442365

Change-Id: Ieb188cba6945b96e99bad4ceba4b53112383fd57

Revert "audio: fix for audio recording"

This reverts commit 28438e79d90a9112da9969c6b09989d35283a522.

Revert "audio: enabled SSR in HAL"

This reverts commit 22ab3ee1288f1cd7ca96a0860de58fb2f7dc8007.

Revert "Revert "audio: fix for audio recording""

This reverts commit 406fba51a0fe4cb89fc2670fa61221f0e70a3fb1.
alsa: fix resampler logic

This re-adds the original define for this while also permitting
the ability to bypass it.

Change-Id: Ie042732814d5848f7aba95918f2f48e4e5acda5f
Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
alsa : check for valid verb index

- Check for valid verb index before indexing into the use case list
- This is to prevent an invalid lookup with a verb_index value of -1

Change-Id: I4676bd0c9b00364c185e77120744b39d8a675acb
CRs-Fixed: 436857
Update copyright to The Linux Foundation

Change-Id: I482b7fd6b5502b86ca095a1b7bce4f03c10c9304
 Fix for MT call ringtone on USB headset

- Issue:when usb headset connected MT call ringtone heard
  only on speaker and expected behaviour is ringtone should
  be heard on both speaker and usb headset.
- Fixed by defining combo device usb proxy rx speaker

Change-Id: I0474651ed6fa40636038dcd7b25c7962cecc7239
CRs-Fixed: 443227
Merge "Audio-CAF: Squash fixes from Code Aurora Forum" into jb-mr1
Merge "alsa: fix resampler logic" into jb-mr1
Merge remote-tracking branch 'aokp/jb-mr1' into HEAD
Merge "audio: fix to play Skype calltone on earpiece instead of speaker"