Linux build fix
Add empty android_errorWriteLog implementation for Linux
Add missing license headers
Fix BUILD.gn files
Test: compile using ninja
Change-Id: I9be297d5847b4c0856786738eac2c30424593919
diff --git a/bta/BUILD.gn b/bta/BUILD.gn
index e519b69..648322f 100644
--- a/bta/BUILD.gn
+++ b/bta/BUILD.gn
@@ -49,6 +49,8 @@
"gatt/bta_gatts_api.cc",
"gatt/bta_gatts_main.cc",
"gatt/bta_gatts_utils.cc",
+ "gatt/database.cc",
+ "gatt/database_builder.cc",
"hearing_aid/hearing_aid.cc",
"hearing_aid/hearing_aid_audio_source.cc",
"hf_client/bta_hf_client_act.cc",
@@ -101,6 +103,8 @@
"include",
"sys",
"//",
+ "//linux_include",
+ "//bta",
"//internal_include",
"//btcore/include",
"//hci/include",
@@ -121,5 +125,31 @@
deps = [
"//third_party/libchrome:base"
]
-
}
+
+executable("net_test_bta") {
+ testonly = true
+ sources = [
+ "test/gatt/database_builder_test.cc",
+ "test/gatt/database_builder_sample_device_test.cc",
+ "test/gatt/database_test.cc",
+ "gatt/database.cc",
+ "gatt/database_builder.cc",
+ ]
+
+ include_dirs = [
+ "include",
+ "//",
+ "//bta",
+ "//btcore/include",
+ "//hci/include",
+ "//internal_include",
+ "//stack/btm",
+ ]
+
+ deps = [
+ "//types",
+ "//third_party/googletest:gmock_main",
+ "//third_party/libchrome:base",
+ ]
+}
\ No newline at end of file
diff --git a/bta/gatt/database.cc b/bta/gatt/database.cc
index df92a71..5f99d55 100644
--- a/bta/gatt/database.cc
+++ b/bta/gatt/database.cc
@@ -1,3 +1,21 @@
+/******************************************************************************
+ *
+ * Copyright 2018 The Android Open Source Project
+ *
+ * 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.
+ *
+ ******************************************************************************/
+
#include "database.h"
#include "bt_trace.h"
#include "stack/include/gattdefs.h"
diff --git a/bta/gatt/database_builder.cc b/bta/gatt/database_builder.cc
index 51d26fe..ed065ab 100644
--- a/bta/gatt/database_builder.cc
+++ b/bta/gatt/database_builder.cc
@@ -1,3 +1,21 @@
+/******************************************************************************
+ *
+ * Copyright 2018 The Android Open Source Project
+ *
+ * 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.
+ *
+ ******************************************************************************/
+
#include "database_builder.h"
#include "bt_trace.h"
diff --git a/btif/BUILD.gn b/btif/BUILD.gn
index a760c8a..56a8d33 100644
--- a/btif/BUILD.gn
+++ b/btif/BUILD.gn
@@ -80,6 +80,7 @@
include_dirs = [
"include",
"//",
+ "//linux_include",
"//audio_a2dp_hw/include",
"//audio_hearing_aid_hw/include",
"//bta/include",
diff --git a/btif/src/btif_sdp_server.cc b/btif/src/btif_sdp_server.cc
index 4738da4..d3a8808 100644
--- a/btif/src/btif_sdp_server.cc
+++ b/btif/src/btif_sdp_server.cc
@@ -28,6 +28,7 @@
#define LOG_TAG "bt_btif_sdp_server"
+#include <log/log.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
diff --git a/build/secondary/third_party/libchrome/BUILD.gn b/build/secondary/third_party/libchrome/BUILD.gn
index 9ffdaa7..df6a886 100644
--- a/build/secondary/third_party/libchrome/BUILD.gn
+++ b/build/secondary/third_party/libchrome/BUILD.gn
@@ -133,6 +133,7 @@
"base/strings/sys_string_conversions_posix.cc",
"base/strings/utf_string_conversions.cc",
"base/strings/utf_string_conversion_utils.cc",
+ "base/synchronization/atomic_flag.cc",
"base/synchronization/condition_variable_posix.cc",
"base/synchronization/lock.cc",
"base/synchronization/lock_impl_posix.cc",
diff --git a/linux_include/log/log.h b/linux_include/log/log.h
new file mode 100644
index 0000000..7149470
--- /dev/null
+++ b/linux_include/log/log.h
@@ -0,0 +1,26 @@
+/******************************************************************************
+ *
+ * Copyright 2018 The Android Open Source Project
+ *
+ * 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.
+ *
+ ******************************************************************************/
+
+/* This file provides empty implementation of android_errorWriteLog, which is
+ * not required on linux. It should be on include path only for linux build. */
+
+#if defined(OS_GENERIC)
+
+inline int android_errorWriteLog(int, const char*) { return 0; };
+
+#endif
diff --git a/profile/avrcp/BUILD.gn b/profile/avrcp/BUILD.gn
index 9144bb8..c37e0a7 100644
--- a/profile/avrcp/BUILD.gn
+++ b/profile/avrcp/BUILD.gn
@@ -22,6 +22,7 @@
include_dirs = [
"//",
+ "//btcore/include",
"//internal_include",
"//stack/include",
"//profile/avrcp",