Merge remote-tracking branch 'quic/LA.BR.1' into HEAD

* quic/LA.BR.1: (37 commits)
  hal: Performance mode during recording usecase
  audio: Support for compress offload recovery
  audio: Fix for clip skip issue during SSR
  hal: add checks for calibration buffer allocation failures
  mm-audio: aenc-aac: fix integer overflow for encoded buffer timestamp calculation
  hal: Add support for 8909 QRD skue
  hal: Fix for FM mute issue on start of FM record
  hal: Fix array length computation for backend id array.
  hal : set Non SA+ app type for PCM Capture
  hal : Fix for SA+ app type selection for PCM Capture usecase
  hal : Fix for SA+ app type selection for PCM Capture usecase
  hal: use 0 as default return value for out_get_render_position
  audio: hal: Add support for pm8916 on msm8909
  hal: Define a new combo device for AANC and Fluence
  hal: Define a new combo device for AANC and Fluence
  hal: use 0 as default return value for out_get_render_position
  hal: Update DS2 implementation to support ACDB based license mechanism
  hal : Overwrite the APP type for PCM RX and TX path
  audio: HAL to support for peripheral manager
  hal : Set the input device for VOIP calls using audio path
  ...
Conflicts:
	hal/Android.mk
	hal/audio_extn/audio_extn.c
	hal/audio_extn/audio_extn.h
	hal/audio_extn/dolby.c
	hal/audio_extn/utils.c
	hal/audio_hw.c
	hal/msm8916/hw_info.c
	hal/msm8916/platform.c
	hal/msm8974/platform.c
	hal/platform_api.h
Change-Id: Ibfa171e8f3af713dbb2cffbaf2ca2b0df3e8ae73
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
old mode 100644
new mode 100755
index 1c19a61..e178712
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1461,12 +1461,20 @@
     return backend_bit_width_table[snd_device];
 }
 
-int platform_send_audio_calibration(void *platform, snd_device_t snd_device,
+int platform_send_audio_calibration(void *platform, struct audio_usecase *usecase,
                                     int app_type, int sample_rate)
 {
     struct platform_data *my_data = (struct platform_data *)platform;
     int acdb_dev_id, acdb_dev_type;
+    struct audio_device *adev = my_data->adev;
+    int snd_device = SND_DEVICE_OUT_SPEAKER;
 
+    if (usecase->type == PCM_PLAYBACK)
+        snd_device = platform_get_output_snd_device(adev->platform,
+                                            usecase->stream.out->devices);
+    else if ((usecase->type == PCM_HFP_CALL) || (usecase->type == PCM_CAPTURE))
+        snd_device = platform_get_input_snd_device(adev->platform,
+                                            adev->primary_output->devices);
     acdb_dev_id = acdb_device_table[audio_extn_get_spkr_prot_snd_device(snd_device)];
     if (acdb_dev_id < 0) {
         ALOGE("%s: Could not find acdb id for device(%d)",
@@ -3150,7 +3158,6 @@
      *device_to_be_id = msm_device_to_be_id;
      *length = msm_be_id_array_len;
 }
-
 int platform_set_stream_channel_map(void *platform, audio_channel_mask_t channel_mask, int snd_id)
 {
     int ret = 0;