audiohal: Fix compilation error

Fix compilation error in LE for 4.0 component.

Change-Id: I7378165d6330e070348bdbc74cb8d19e4bccefbc
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index 2103930..0fae7f2 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -221,7 +221,13 @@
     struct custom_enc_cfg_t  custom_cfg;
     struct celt_specific_enc_cfg_t celt_cfg;
 };
-
+/* In LE BT source code uses system/audio.h for below
+ * structure definition. To avoid multiple definition
+ * compilation error for audiohal in LE , masking structure
+ * definition under "LINUX_ENABLED" which is defined only
+ * in LE
+ */
+#ifndef LINUX_ENABLED
 /* TODO: Define the following structures only for O using PLATFORM_VERSION */
 /* Information about BT SBC encoder configuration
  * This data is used between audio HAL module and
@@ -238,7 +244,6 @@
     uint32_t bitrate;        /* 320kbps to 512kbps */
 } audio_sbc_encoder_config;
 
-
 /* Information about BT APTX encoder configuration
  * This data is used between audio HAL module and
  * BT IPC library to configure DSP encoder
@@ -261,6 +266,7 @@
     uint32_t sampling_rate;
     uint32_t bitrate;
 } audio_aac_encoder_config;
+#endif
 
 /* Information about BT CELT encoder configuration
  * This data is used between audio HAL module and
diff --git a/hal/audio_hw_extn_api.c b/hal/audio_hw_extn_api.c
index 09d83f4..4e49a83 100644
--- a/hal/audio_hw_extn_api.c
+++ b/hal/audio_hw_extn_api.c
@@ -376,6 +376,9 @@
         return -EINVAL;
     }
 
+    if (flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM)
+        flags = (flags & ~AUDIO_OUTPUT_FLAG_DIRECT_PCM ) | AUDIO_OUTPUT_FLAG_DIRECT;
+
     ret = adev->qahwi_dev.base.open_output_stream(dev, handle, devices, flags,
                                                  config, stream_out, address);
     if (ret)
diff --git a/qahw_api/test/qahw_playback_test.c b/qahw_api/test/qahw_playback_test.c
index fb69d93..6ed3341 100644
--- a/qahw_api/test/qahw_playback_test.c
+++ b/qahw_api/test/qahw_playback_test.c
@@ -172,6 +172,7 @@
    if (enable) {
        if (!wakelock_acquired) {
            system_ret = system("echo audio_services > /sys/power/wake_lock");
+           if (system_ret < 0) {
                fprintf(stderr, "%s.Failed to acquire audio_service lock\n", __func__);
                fprintf(log_file, "%s.Failed to acquire audio_service lock\n", __func__);
            } else {
@@ -1010,7 +1011,7 @@
             else
                 stream_info->config.offload_info.format = AUDIO_FORMAT_PCM_16_BIT;
             if (!(stream_info->flags_set))
-                stream_info->flags = AUDIO_OUTPUT_FLAG_DIRECT_PCM|AUDIO_OUTPUT_FLAG_DIRECT;
+                stream_info->flags = AUDIO_OUTPUT_FLAG_DIRECT;
             break;
 
         case FILE_MP3: