hal: make sure hal compiles with AOSP flag

 Make sure if the TARGET_USES_AOSP flag is defined
 then all QTI specific features should be disabled
 and compilation is successfull.

Change-Id: I440b538b5449177e14ca47f1dcfbec70a2ee7fed
diff --git a/configs/msm8937/msm8937.mk b/configs/msm8937/msm8937.mk
index 3d932b0..df9cb66 100644
--- a/configs/msm8937/msm8937.mk
+++ b/configs/msm8937/msm8937.mk
@@ -2,30 +2,18 @@
 
 #BOARD_USES_GENERIC_AUDIO := true
 BOARD_USES_ALSA_AUDIO := true
+
+ifneq ($(TARGET_USES_AOSP), true)
 USE_CUSTOM_AUDIO_POLICY := 1
-USE_XML_AUDIO_POLICY_CONF := 1
-BOARD_SUPPORTS_SOUND_TRIGGER := true
-AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
-AUDIO_FEATURE_ENABLED_HIFI_AUDIO := true
-AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
 #AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY := true
 AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
-AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true
-AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
 AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false
 AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
-AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
 AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
 AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
 AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
 AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
-AUDIO_FEATURE_ENABLED_FLUENCE := true
 AUDIO_FEATURE_ENABLED_HDMI_SPK := true
-AUDIO_FEATURE_ENABLED_HDMI_EDID := true
-AUDIO_FEATURE_ENABLED_EXT_HDMI := true
-AUDIO_FEATURE_ENABLED_HFP := true
-AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
-AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
 AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
@@ -34,30 +22,52 @@
 AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
-AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
-AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
 AUDIO_FEATURE_ENABLED_SSR := true
-AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
 AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
 BOARD_USES_SRS_TRUEMEDIA := true
 DTS_CODEC_M_ := true
-AUDIO_FEATURE_ENABLED_DEV_ARBI := false
-MM_AUDIO_ENABLED_FTM := true
 MM_AUDIO_ENABLED_SAFX := true
-TARGET_USES_QCOM_MM_AUDIO := true
 AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
 AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
-AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
+endif
+
+USE_XML_AUDIO_POLICY_CONF := 1
+BOARD_SUPPORTS_SOUND_TRIGGER := true
+AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
+AUDIO_FEATURE_ENABLED_HIFI_AUDIO := true
+AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
+AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true
+AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
+AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
+AUDIO_FEATURE_ENABLED_FLUENCE := true
+AUDIO_FEATURE_ENABLED_HDMI_EDID := true
+AUDIO_FEATURE_ENABLED_EXT_HDMI := true
+AUDIO_FEATURE_ENABLED_HFP := true
+AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
+AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
+AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
+AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
+AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
+AUDIO_FEATURE_ENABLED_DEV_ARBI := false
+MM_AUDIO_ENABLED_FTM := true
+TARGET_USES_QCOM_MM_AUDIO := true
+AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 ##AUDIO_FEATURE_FLAGS
 
 #Audio Specific device overlays
 DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio/configs/common/overlay
 
-## Audio configuration file
+# Audio configuration file
+ifeq ($(TARGET_USES_AOSP), true)
+PRODUCT_COPY_FILES += \
+    device/qcom/common/media/audio_policy.conf:system/etc/audio_policy.conf
+else
+PRODUCT_COPY_FILES += \
+    hardware/qcom/audio/configs/msm8937/audio_policy.conf:system/etc/audio_policy.conf
+endif
 
 PRODUCT_COPY_FILES +=\
-hardware/qcom/audio/configs/msm8937/audio_policy.conf:system/etc/audio_policy.conf\
 hardware/qcom/audio/configs/msm8937/audio_output_policy.conf:system/vendor/etc/audio_output_policy.conf\
 hardware/qcom/audio/configs/msm8937/audio_effects.conf:system/vendor/etc/audio_effects.conf\
 hardware/qcom/audio/configs/msm8937/mixer_paths_mtp.xml:system/etc/mixer_paths_mtp.xml \
diff --git a/configs/msm8953/msm8953.mk b/configs/msm8953/msm8953.mk
index 96c9a5d..2149a7b 100644
--- a/configs/msm8953/msm8953.mk
+++ b/configs/msm8953/msm8953.mk
@@ -1,30 +1,17 @@
 ##AUDIO_FEATURE_FLAGS
 #BOARD_USES_GENERIC_AUDIO := true
 BOARD_USES_ALSA_AUDIO := true
+
+ifneq ($(TARGET_USES_AOSP), true)
 USE_CUSTOM_AUDIO_POLICY := 1
-USE_XML_AUDIO_POLICY_CONF := 1
-BOARD_SUPPORTS_SOUND_TRIGGER := true
-AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
-AUDIO_FEATURE_ENABLED_HIFI_AUDIO := true
-AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
 #AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY := true
 AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
-AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true
-AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
 AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false
 AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
-AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
 AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
 AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
 AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
 AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
-AUDIO_FEATURE_ENABLED_FLUENCE := true
-AUDIO_FEATURE_ENABLED_HDMI_SPK := true
-AUDIO_FEATURE_ENABLED_HDMI_EDID := true
-AUDIO_FEATURE_ENABLED_EXT_HDMI := true
-AUDIO_FEATURE_ENABLED_HFP := true
-AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
-AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
 AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
@@ -33,33 +20,54 @@
 AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
-AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
-AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
 AUDIO_FEATURE_ENABLED_SSR := true
-AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
 AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
 BOARD_USES_SRS_TRUEMEDIA := true
 DTS_CODEC_M_ := true
 #AUDIO_FEATURE_ENABLED_MULTIPLE_TUNNEL := true
-AUDIO_FEATURE_ENABLED_DEV_ARBI := false
-MM_AUDIO_ENABLED_FTM := true
 MM_AUDIO_ENABLED_SAFX := true
-TARGET_USES_QCOM_MM_AUDIO := true
 AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
 AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
-
-AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
+endif
 
+USE_XML_AUDIO_POLICY_CONF := 1
+BOARD_SUPPORTS_SOUND_TRIGGER := true
+AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
+AUDIO_FEATURE_ENABLED_HIFI_AUDIO := true
+AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
+AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true
+AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
+AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
+AUDIO_FEATURE_ENABLED_FLUENCE := true
+AUDIO_FEATURE_ENABLED_HDMI_SPK := true
+AUDIO_FEATURE_ENABLED_HDMI_EDID := true
+AUDIO_FEATURE_ENABLED_EXT_HDMI := true
+AUDIO_FEATURE_ENABLED_HFP := true
+AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
+AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
+AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
+AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
+AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
+AUDIO_FEATURE_ENABLED_DEV_ARBI := false
+MM_AUDIO_ENABLED_FTM := true
+TARGET_USES_QCOM_MM_AUDIO := true
+AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 ##AUDIO_FEATURE_FLAGS
 
 #Audio Specific device overlays
 DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio/configs/common/overlay
 
-## Audio configuration file
+# Audio configuration file
+ifeq ($(TARGET_USES_AOSP), true)
+PRODUCT_COPY_FILES += \
+    device/qcom/common/media/audio_policy.conf:system/etc/audio_policy.conf
+else
+PRODUCT_COPY_FILES += \
+    hardware/qcom/audio/configs/msm8953/audio_policy.conf:system/etc/audio_policy.conf
+endif
 
 PRODUCT_COPY_FILES += \
-hardware/qcom/audio/configs/msm8953/audio_policy.conf:system/etc/audio_policy.conf \
 hardware/qcom/audio/configs/msm8953/audio_output_policy.conf:system/vendor/etc/audio_output_policy.conf \
 hardware/qcom/audio/configs/msm8953/audio_effects.conf:system/vendor/etc/audio_effects.conf \
 hardware/qcom/audio/configs/msm8953/mixer_paths_mtp.xml:system/etc/mixer_paths_mtp.xml \
diff --git a/configs/msm8996/msm8996.mk b/configs/msm8996/msm8996.mk
index 6d3fa4b..26e0bb1 100644
--- a/configs/msm8996/msm8996.mk
+++ b/configs/msm8996/msm8996.mk
@@ -2,28 +2,16 @@
 #
 #AUDIO_FEATURE_FLAGS
 BOARD_USES_ALSA_AUDIO := true
-USE_CUSTOM_AUDIO_POLICY := 1
-BOARD_SUPPORTS_SOUND_TRIGGER := true
-AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
-USE_XML_AUDIO_POLICY_CONF := 1
 
-AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
-AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
+ifneq ($(TARGET_USES_AOSP), true)
+USE_CUSTOM_AUDIO_POLICY := 1
 AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false
 AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
-AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
 AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
 AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
 AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
 AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
-AUDIO_FEATURE_ENABLED_FLUENCE := true
 AUDIO_FEATURE_ENABLED_HDMI_SPK := true
-AUDIO_FEATURE_ENABLED_HDMI_EDID := true
-#AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH := true
-#AUDIO_FEATURE_ENABLED_KEEP_ALIVE := true
-AUDIO_FEATURE_ENABLED_HFP := true
-AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
-AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
 AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
@@ -33,23 +21,36 @@
 AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
-AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
-AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
 AUDIO_FEATURE_ENABLED_SSR := true
-AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
-
 AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
 BOARD_USES_SRS_TRUEMEDIA := true
 DTS_CODEC_M_ := true
-AUDIO_FEATURE_ENABLED_DEV_ARBI := false
-MM_AUDIO_ENABLED_FTM := true
 MM_AUDIO_ENABLED_SAFX := true
-TARGET_USES_QCOM_MM_AUDIO := true
 AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
 AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
-
-AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
+endif
+
+USE_XML_AUDIO_POLICY_CONF := 1
+BOARD_SUPPORTS_SOUND_TRIGGER := true
+AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
+AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
+AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
+AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
+AUDIO_FEATURE_ENABLED_FLUENCE := true
+AUDIO_FEATURE_ENABLED_HDMI_EDID := true
+#AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH := true
+#AUDIO_FEATURE_ENABLED_KEEP_ALIVE := true
+AUDIO_FEATURE_ENABLED_HFP := true
+AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
+AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
+AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
+AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
+AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
+AUDIO_FEATURE_ENABLED_DEV_ARBI := false
+MM_AUDIO_ENABLED_FTM := true
+TARGET_USES_QCOM_MM_AUDIO := true
+AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
 ##AUDIO_FEATURE_FLAGS
 
diff --git a/configs/msm8998/msm8998.mk b/configs/msm8998/msm8998.mk
index 795dfc1..94079aa 100644
--- a/configs/msm8998/msm8998.mk
+++ b/configs/msm8998/msm8998.mk
@@ -2,30 +2,16 @@
 #
 #AUDIO_FEATURE_FLAGS
 BOARD_USES_ALSA_AUDIO := true
-USE_CUSTOM_AUDIO_POLICY := 1
-USE_XML_AUDIO_POLICY_CONF := 1
-BOARD_SUPPORTS_SOUND_TRIGGER_HAL := true
-AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
 
-AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
-AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
+ifneq ($(TARGET_USES_AOSP), true)
+USE_CUSTOM_AUDIO_POLICY := 1
 AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false
 AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
-AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
 AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
 AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
 AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
 AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
-AUDIO_FEATURE_ENABLED_FLUENCE := true
 AUDIO_FEATURE_ENABLED_HDMI_SPK := true
-AUDIO_FEATURE_ENABLED_HDMI_EDID := true
-AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH := true
-#AUDIO_FEATURE_ENABLED_KEEP_ALIVE := true
-AUDIO_FEATURE_ENABLED_DISPLAY_PORT := true
-AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
-AUDIO_FEATURE_ENABLED_HFP := true
-AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
-AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
 AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
@@ -35,25 +21,40 @@
 AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
 AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
-AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
-AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
 AUDIO_FEATURE_ENABLED_SSR := true
-AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
-
 AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
 BOARD_USES_SRS_TRUEMEDIA := false
 DTS_CODEC_M_ := false
-AUDIO_FEATURE_ENABLED_DEV_ARBI := false
-MM_AUDIO_ENABLED_FTM := true
 MM_AUDIO_ENABLED_SAFX := true
-TARGET_USES_QCOM_MM_AUDIO := true
 AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
-
-AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
 AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
-AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
 AUDIO_FEATURE_ENABLED_USB_TUNNEL_AUDIO := true
 AUDIO_FEATURE_ENABLED_SPLIT_A2DP := true
+endif
+
+USE_XML_AUDIO_POLICY_CONF := 1
+BOARD_SUPPORTS_SOUND_TRIGGER_HAL := true
+AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
+AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
+AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
+AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
+AUDIO_FEATURE_ENABLED_FLUENCE := true
+AUDIO_FEATURE_ENABLED_HDMI_EDID := true
+AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH := true
+#AUDIO_FEATURE_ENABLED_KEEP_ALIVE := true
+AUDIO_FEATURE_ENABLED_DISPLAY_PORT := true
+AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
+AUDIO_FEATURE_ENABLED_HFP := true
+AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
+AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
+AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
+AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
+AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
+AUDIO_FEATURE_ENABLED_DEV_ARBI := false
+MM_AUDIO_ENABLED_FTM := true
+TARGET_USES_QCOM_MM_AUDIO := true
+AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
+AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
 ##AUDIO_FEATURE_FLAGS
 
 #Audio Specific device overlays
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 944da79..659592c 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -95,6 +95,7 @@
                                    :config->offload_info.bit_width)
 #else
 #define AUDIO_OUTPUT_BIT_WIDTH (CODEC_BACKEND_DEFAULT_BIT_WIDTH)
+#define compress_set_next_track_param(compress, codec_options) (0)
 #endif
 
 #define MAX_LENGTH_MIXER_CONTROL_IN_INT                  (128)
diff --git a/hal/edid.h b/hal/edid.h
index 6a82103..da5c592 100644
--- a/hal/edid.h
+++ b/hal/edid.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -92,14 +92,30 @@
     int  channel_allocation;
 } edid_audio_info;
 
-#ifndef HDMI_EDID
-#define edid_get_sink_caps(info, edid_data) (0)
-#else
-bool edid_get_sink_caps(edid_audio_info* info, char *edid_data);
-#endif
-
+#ifdef HDMI_EDID
 bool edid_is_supported_sr(edid_audio_info* info, int sr);
 bool edid_is_supported_bps(edid_audio_info* info, int bps);
 int edid_get_highest_supported_sr(edid_audio_info* info);
+bool edid_get_sink_caps(edid_audio_info* info, char *edid_data);
+#else
+static bool __unused edid_is_supported_sr(edid_audio_info* info __unused, int sr __unused)
+{
+    return false;
+}
+static bool __unused edid_is_supported_bps(edid_audio_info* info __unused, int bps __unused)
+{
+    return false;
+}
+
+static bool __unused edid_get_sink_caps(edid_audio_info* info __unused, char* edid_data __unused)
+{
+    return false;
+}
+
+static int __unused edid_get_highest_supported_sr(edid_audio_info* info __unused)
+{
+    return 0;
+}
+#endif
 
 #endif /* EDID_H */
diff --git a/hal/voice_extn/voice_extn.h b/hal/voice_extn/voice_extn.h
index dcce0ab..2f879bd 100644
--- a/hal/voice_extn/voice_extn.h
+++ b/hal/voice_extn/voice_extn.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2016-2017, The Linux Foundation. All rights reserved.
  * Not a contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -43,58 +43,58 @@
                                    struct str_parms *query,
                                    struct str_parms *reply);
 #else
-static int voice_extn_start_call(struct audio_device *adev __unused)
+static int __unused voice_extn_start_call(struct audio_device *adev __unused)
 {
     return -ENOSYS;
 }
 
-static int voice_extn_stop_call(struct audio_device *adev __unused)
+static int __unused voice_extn_stop_call(struct audio_device *adev __unused)
 {
     return -ENOSYS;
 }
 
-static int voice_extn_get_session_from_use_case(struct audio_device *adev __unused,
+static int __unused voice_extn_get_session_from_use_case(struct audio_device *adev __unused,
                                                 const audio_usecase_t usecase_id __unused,
                                                 struct voice_session **session __unused)
 {
     return -ENOSYS;
 }
 
-static void voice_extn_init(struct audio_device *adev __unused)
+static void __unused voice_extn_init(struct audio_device *adev __unused)
 {
 }
 
-static int voice_extn_set_parameters(struct audio_device *adev __unused,
+static int __unused voice_extn_set_parameters(struct audio_device *adev __unused,
                                      struct str_parms *parms __unused)
 {
     return -ENOSYS;
 }
 
-static void voice_extn_get_parameters(const struct audio_device *adev __unused,
+static void __unused voice_extn_get_parameters(const struct audio_device *adev __unused,
                                       struct str_parms *query __unused,
                                       struct str_parms *reply __unused)
 {
 }
 
-static int voice_extn_is_call_state_active(struct audio_device *adev __unused,
+static int __unused voice_extn_is_call_state_active(struct audio_device *adev __unused,
                                            bool *is_call_active __unused)
 {
     return -ENOSYS;
 }
 
-static int voice_extn_get_active_session_id(struct audio_device *adev __unused,
+static int __unused voice_extn_get_active_session_id(struct audio_device *adev __unused,
                                             uint32_t *session_id __unused)
 {
     return -ENOSYS;
 }
 
-static void voice_extn_in_get_parameters(struct stream_in *in __unused,
+static void __unused voice_extn_in_get_parameters(struct stream_in *in __unused,
                                          struct str_parms *query __unused,
                                          struct str_parms *reply __unused)
 {
 }
 
-static void voice_extn_out_get_parameters(struct stream_out *out __unused,
+static void __unused voice_extn_out_get_parameters(struct stream_out *out __unused,
                                           struct str_parms *query __unused,
                                           struct str_parms *reply __unused)
 {
@@ -143,130 +143,153 @@
 bool voice_extn_compress_voip_is_config_supported(struct audio_config *config);
 bool voice_extn_compress_voip_is_started(struct audio_device *adev);
 #else
-static int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream __unused)
+static int __unused voice_extn_compress_voip_close_output_stream(
+                                     struct audio_stream *stream __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_open_output_stream(struct stream_out *out __unused)
+static int __unused voice_extn_compress_voip_open_output_stream(
+                                         struct stream_out *out __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_close_input_stream(struct audio_stream *stream __unused)
+static int __unused voice_extn_compress_voip_close_input_stream(
+                                    struct audio_stream *stream __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_open_input_stream(struct stream_in *in __unused)
+static int __unused voice_extn_compress_voip_open_input_stream(
+                                          struct stream_in *in __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *stream __unused)
+static int __unused voice_extn_compress_voip_out_get_buffer_size(
+                                       struct stream_out *stream __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_in_get_buffer_size(struct stream_in *in __unused)
+static int __unused voice_extn_compress_voip_in_get_buffer_size(
+                                           struct stream_in *in __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_start_input_stream(struct stream_in *in __unused)
+static int __unused voice_extn_compress_voip_start_input_stream(
+                                           struct stream_in *in __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_start_output_stream(struct stream_out *out __unused)
+static int __unused voice_extn_compress_voip_start_output_stream(
+                                          struct stream_out *out __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_set_mic_mute(struct audio_device *adev, bool state __unused)
+static int __unused voice_extn_compress_voip_set_mic_mute(
+                                struct audio_device *adev __unused,
+                                bool state __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return 0;
 }
 
-static int voice_extn_compress_voip_set_volume(struct audio_device *adev __unused, float volume __unused)
+static int __unused voice_extn_compress_voip_set_volume(
+                              struct audio_device *adev __unused,
+                              float volume __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return 0;
 }
 
-static int voice_extn_compress_voip_select_devices(struct audio_device *adev __unused,
-                                                   snd_device_t *out_snd_device __unused,
-                                                   snd_device_t *in_snd_device __unused)
+static int __unused voice_extn_compress_voip_select_devices(
+                                  struct audio_device *adev __unused,
+                                  snd_device_t *out_snd_device __unused,
+                                  snd_device_t *in_snd_device __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static int voice_extn_compress_voip_set_parameters(struct audio_device *adev __unused,
-                                                    struct str_parms *parms __unused)
+static int __unused voice_extn_compress_voip_set_parameters(
+                                  struct audio_device *adev __unused,
+                                  struct str_parms *parms __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return -ENOSYS;
 }
 
-static void voice_extn_compress_voip_get_parameters(struct str_parms *query __unused,
-                                                    struct str_parms *reply __unused)
+static void __unused voice_extn_compress_voip_get_parameters(
+                                     struct str_parms *query __unused,
+                                     struct str_parms *reply __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
 }
 
-static void voice_extn_compress_voip_out_get_parameters(struct stream_out *out __unused,
-                                                        struct str_parms *query __unused,
-                                                        struct str_parms *reply __unused)
+static void __unused voice_extn_compress_voip_out_get_parameters(
+                                          struct stream_out *out __unused,
+                                          struct str_parms *query __unused,
+                                          struct str_parms *reply __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
 }
 
-static void voice_extn_compress_voip_in_get_parameters(struct stream_in *in __unused,
-                                                       struct str_parms *query __unused,
-                                                       struct str_parms *reply __unused)
+static void __unused voice_extn_compress_voip_in_get_parameters(
+                                           struct stream_in *in __unused,
+                                           struct str_parms *query __unused,
+                                           struct str_parms *reply __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
 }
 
-static bool voice_extn_compress_voip_pcm_prop_check()
+static bool __unused voice_extn_compress_voip_pcm_prop_check()
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return false;
 }
 
-static bool voice_extn_compress_voip_is_active(struct audio_device *adev __unused)
+static bool __unused  voice_extn_compress_voip_is_active(
+                         const struct audio_device *adev __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return false;
 }
 
-static bool voice_extn_compress_voip_is_format_supported(audio_format_t format __unused)
+static bool __unused voice_extn_compress_voip_is_format_supported(
+                                            audio_format_t format __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return true;
 }
 
-static bool voice_extn_compress_voip_is_config_supported(struct audio_config *config __unused)
+static bool __unused voice_extn_compress_voip_is_config_supported(
+                                      struct audio_config *config __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return true;
 }
 
-static bool voice_extn_compress_voip_is_started(struct audio_device *adev __unused)
+static bool __unused voice_extn_compress_voip_is_started(
+                               struct audio_device *adev __unused)
 {
     ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
     return false;
 }
+
+#define AUDIO_OUTPUT_FLAG_VOIP_RX 0x800
 #endif
 
 #endif //VOICE_EXTN_H