Get rid of libhardware dependency in native daemon
Test: compilation test
Bug: 66187274
Change-Id: I97ee33a55315f44dc03083d1a8da9a38d5619725
diff --git a/btcore/include/hal_util.h b/btcore/include/hal_util.h
index 46e4906..e14fc4d 100644
--- a/btcore/include/hal_util.h
+++ b/btcore/include/hal_util.h
@@ -18,7 +18,6 @@
struct hw_module_t;
-// Loads the Bluetooth library. If OS_GENERIC is defined, this function looks
-// explicitly for libbluetooth.default.so and loads it. On Android, this calls
-// the hw_get_module routine with the Bluetooth stack module id.
+// Loads the Bluetooth library. This function looks explicitly for
+// libbluetooth.default.so and loads it.
int hal_util_load_bt_library(const struct hw_module_t** module);
diff --git a/btcore/src/hal_util.cc b/btcore/src/hal_util.cc
index 21be613..5d4ab6c 100644
--- a/btcore/src/hal_util.cc
+++ b/btcore/src/hal_util.cc
@@ -26,8 +26,6 @@
#include "btcore/include/hal_util.h"
#include "osi/include/log.h"
-#if defined(OS_GENERIC)
-
// TODO(armansito): All logging macros should include __func__ by default (see
// Bug: 22671731)
#define HULOGERR(fmt, args...) \
@@ -38,7 +36,7 @@
// generic manner as opposed to hard-coding it here.
static const char kBluetoothLibraryName[] = "libbluetooth.default.so";
-static int load_bt_library(const struct hw_module_t** module) {
+int hal_util_load_bt_library(const struct hw_module_t** module) {
const char* id = BT_STACK_MODULE_ID;
const char* sym = HAL_MODULE_INFO_SYM_AS_STR;
struct hw_module_t* hmi = nullptr;
@@ -79,13 +77,3 @@
return -EINVAL;
}
-
-#endif // defined(OS_GENERIC)
-
-int hal_util_load_bt_library(const struct hw_module_t** module) {
-#if defined(OS_GENERIC)
- return load_bt_library(module);
-#else // !defined(OS_GENERIC)
- return hw_get_module(BT_STACK_MODULE_ID, module);
-#endif // defined(OS_GENERIC)
-}
diff --git a/service/Android.bp b/service/Android.bp
index 5c8cb6c..39aec17 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -76,10 +76,11 @@
"libbluetooth-binder-common",
"libbtcore",
],
+
+ header_libs: [ "libhardware_headers" ],
shared_libs: [
"libbinder",
"libcutils",
- "libhardware",
"liblog",
"libutils",
],
diff --git a/test/suite/Android.bp b/test/suite/Android.bp
index 9fe2fa6..03831d7 100644
--- a/test/suite/Android.bp
+++ b/test/suite/Android.bp
@@ -14,7 +14,6 @@
header_libs: ["libhardware_headers"],
shared_libs: [
"liblog",
- "libhardware",
"libcutils",
],
static_libs: [
@@ -37,9 +36,9 @@
"rfcomm/rfcomm_test.cc",
"rfcomm/rfcomm_unittest.cc",
],
+ header_libs: [ "libhardware_headers" ],
shared_libs: [
"liblog",
- "libhardware",
"libcutils",
],
static_libs: [