From c01f3412ff7dce02084cfb9de4919150f3b8b1b5 Mon Sep 17 00:00:00 2001
From: Jakub Pawlowski <jpawlowski@google.com>
Date: Tue, 18 Oct 2016 18:45:21 -0700
Subject: [PATCH] Remove Android a2dp bridge from generic build configuration

Code in audio_a2dp_hw folder contains Android-specific code for talking
to Android media libraries. It is not useful on other platforms, and
only adds unnecessary dependencies.

Test: compile with ninja
Change-Id: Ia0313332b4456ba0287587da66cdf2cce045f89c
---
 README.md                           |  2 --
 system/audio_a2dp_hw/BUILD.gn       | 28 ----------------------------
 system/btif/src/btif_a2dp_source.cc |  2 +-
 system/build/BUILD.gn               |  4 ----
 system/main/BUILD.gn                |  2 --
 5 files changed, 1 insertion(+), 37 deletions(-)
 delete mode 100644 system/audio_a2dp_hw/BUILD.gn

diff --git a/README.md b/README.md
index c6855993d7d..2a5c013a66f 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,6 @@ Fluoride currently has dependency on some internal Android projects, which also
 cd ~/fluoride
 git clone https://android.googlesource.com/platform/system/core
 git clone https://android.googlesource.com/platform/hardware/libhardware
-git clone https://android.googlesource.com/platform/system/media
 ```
 
 ### Configure your build
@@ -102,7 +101,6 @@ This will prompt you to fill the contents of your "out/Default/args.gn" file. Ma
 
 libhw_include_path = "/home/job/fluoride/libhardware/include"
 core_include_path = "/home/job/fluoride/core/include"
-audio_include_path = "/home/job/fluoride/media/audio/include"
 ```
 
 Then generate your build files by calling
diff --git a/system/audio_a2dp_hw/BUILD.gn b/system/audio_a2dp_hw/BUILD.gn
deleted file mode 100644
index e4f592d5779..00000000000
--- a/system/audio_a2dp_hw/BUILD.gn
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#  Copyright (C) 2015 Google, Inc.
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at:
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-#
-
-shared_library("audio.a2dp.default") {
-  sources = [
-    "audio_a2dp_hw.cc",
-    "audio_a2dp_hw_utils.cc",
-  ]
-
-  include_dirs = [
-    "include",
-    "//",
-    "//utils/include",
-  ]
-}
diff --git a/system/btif/src/btif_a2dp_source.cc b/system/btif/src/btif_a2dp_source.cc
index 8548daaeeac..13de212e3a9 100644
--- a/system/btif/src/btif_a2dp_source.cc
+++ b/system/btif/src/btif_a2dp_source.cc
@@ -21,7 +21,7 @@
 
 #include <assert.h>
 #include <limits.h>
-#include <system/audio.h>
+#include <string.h>
 
 #include "audio_a2dp_hw.h"
 #include "bt_common.h"
diff --git a/system/build/BUILD.gn b/system/build/BUILD.gn
index 81a89bcd2c1..601a7504f41 100644
--- a/system/build/BUILD.gn
+++ b/system/build/BUILD.gn
@@ -18,7 +18,6 @@ declare_args() {
   # Include path for hardware/bluetooth.h
   libhw_include_path = ""
   core_include_path = ""
-  audio_include_path = ""
 }
 
 config("default_include_dirs") {
@@ -28,12 +27,9 @@ config("default_include_dirs") {
          "libhardware_include_path build argument wasn't provided.")
   assert(core_include_path != "",
          "core_include_path build argument wasn't provided.")
-  assert(audio_include_path != "",
-         "audio_include_path build argument wasn't provided.")
   include_dirs = [
     libhw_include_path,
     core_include_path,
-    audio_include_path,
   ]
 }
 
diff --git a/system/main/BUILD.gn b/system/main/BUILD.gn
index 704dcbd26e5..d41f5a3b673 100644
--- a/system/main/BUILD.gn
+++ b/system/main/BUILD.gn
@@ -52,13 +52,11 @@ shared_library("bluetooth.default") {
     "//brcm/include",
     "//embdrv/sbc/encoder/include",
     "//embdrv/sbc/decoder/include",
-    "//audio_a2dp_hw",
     "//utils/include",
     "//test/suite",
   ]
 
   deps = [
-    "//audio_a2dp_hw:audio.a2dp.default",
     "//bta",
     "//btcore",
     "//btif",
-- 
GitLab