audio: getNewDevice on primaryOutput for strategy phone and enforced audio

- only device for primaryOutputDesc will be used for STRATEGY_PHONE and
  STRATEGY_ENFORCED_AUDIBLE, request a routing change only on primary
  output for these two strategy

Change-Id: Ibb2c01f5d81886ad195662af2c5870ec9301cf30
CRs-Fixed: 446946
libalsa_intf: Add USB acdb IDs for voice over USB

- Add USB Rx and Tx acdb ID for voice over USB

Change-Id: I6ac9c7ed81dd0189dba5fa8ad3eabe3dbe93e1ef
alsa_sound : Handle sound card detection failures

-If sound card is not detected, the error was not handled
 gracefully. This results in media server crash.
-If there is an error in AudioHardwareALSA constructor update the
 error and delete/clear HAL instance. This prevents the media
 server crash if sound card is not detected.

Change-Id: I6e5991d678ed374a55de722f16072bf5b2b28141
CRs-Fixed: 457318
alsa_sound: Add missing param.remove(key) in setParameters

AudioHardwareALSA::setParameters(const String8& keyValuePairs) will
return BAD_VALUE unless all keys provided have been consumed.

Added the missing param.remove(key) to the processing blocks for
TTY_MODE_KEY, AudioParameter::keyFluenceType, INCALLMUSIC_KEY,
ANC_KEY, BTHEADSET_VGS and MODE_CALL_KEY so that the keys are properly
consumed
CRs-Fixed: 455037
Change-Id: I886b0195dbbfcdf2a292d79d09c27bc8edb928a3
Merge "alsa_sound: Add missing param.remove(key) in setParameters"
Merge "audio: getNewDevice on primaryOutput for strategy phone and enforced audio"
alsa_sound: Change SGLTE to Voice2 for reusability of code

Replace SGLTE with Voice2 for reusability of code.

Change-Id: I6f068fddaf2737dc79d42f06a15ed14bd24d5562
Merge "libalsa_intf: Add USB acdb IDs for voice over USB"
alsa_sound: Fix race condition in close and open device

-Play ringtones over USB headset. Switch fast between ringtones
-The playback thread exit and open device in USB are not locked
 causing a failure for the next ringtone session. This causes a
 native crash.
-The fix is to lock the exit path and open/configuraton of usb/pcm
 device.

Change-Id: I532b528c68e26b35f565b2a93b310146621d942d
CRs-Fixed: 458590
Merge "alsa_sound: Change SGLTE to Voice2 for reusability of code"
Merge "alsa_sound : Handle sound card detection failures"
Merge "alsa_sound: Fix race condition in close and open device"
alsa_sound: Add support for new UCM file for SGLTE

-Adding support for SGLTE 8x30 QRD platform

Change-Id: Ic58db70619cc92dab70c98751f112384afd77d17
Merge "alsa_sound: Add support for new UCM file for SGLTE"
Primary output check for sonification is removed.

 - When there are 3 different tracks (Ringtone, Music and Touchtone)
   the device switch happens for touchtones to primary if the primary
   output is active. This can lead to music being played in combo
   due to timing issue.
 - This is mainly because we have a check for, primary output if
   active we return true for SONIFICATION. This will set SONIFICATION
   for touch tones and this device switch will come after music device
   is set.
 - Hence music will start playing as SONIFICATION.
 - We have removed the primar output check for getting device strategy

CRs-Fixed: 456842
Change-Id: I8d49d7bcd46f06c0dffe87f6f3944027dee1bcc8

Conflicts:

	alsa_sound/AudioPolicyManagerALSA.cpp
audio: refactor HAL to call session id based CSD apis

To support multiple sessions such as Voice2, VoLTE in CSD,
the CSD apis are refactored to have session ID as argument to
uniquely identify sessions.

Add support in HAL to call session ID based CSD apis.

Change-Id: I46ba0d033f3ddac2955cd6c59b61655739a32b2c
Merge "audio: refactor HAL to call session id based CSD apis"
Merge "Primary output check for sonification is removed."
alsa_sound: Fix for audio glitch on headset during FM playback

- checkDeviceMuteStrategies() is muting and unmuting the stream
  when headset is connected. This is resulting in audio glitch.
- Remove checkDeviceMuteStrategies() function call.

Change-Id: Idaed450a58eabfacda60beafeae6f9ab45d06e3b
CRs-Fixed: 448577
Merge "alsa_sound: Fix for audio glitch on headset during FM playback"