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/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