hw/bluetooth.default.so -> libbluetooth.so (1/2)
Also rename the build goal for both the library and headers.
Bug: 67853426
Test: run Bluetooth
Merged-In: Iaffeebc1d3f2761e13f6d66d4e855dc342603054
Change-Id: Iaffeebc1d3f2761e13f6d66d4e855dc342603054
(cherry picked from commit 842ff8ed7f5b00d5f6da9d975f37e65c41bb8ebc)
diff --git a/system/bta/Android.bp b/system/bta/Android.bp
index 95ec69f..0a421fc 100644
--- a/system/bta/Android.bp
+++ b/system/bta/Android.bp
@@ -23,7 +23,7 @@
shared_libs: [
"libcutils",
],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
cflags: ["-DBUILDCFG"],
}
diff --git a/system/btcore/Android.bp b/system/btcore/Android.bp
index d7442b6..d2a5884 100644
--- a/system/btcore/Android.bp
+++ b/system/btcore/Android.bp
@@ -15,7 +15,7 @@
shared_libs: [
"liblog",
],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
host_supported: true,
target: {
darwin: {
diff --git a/system/btcore/include/hal_util.h b/system/btcore/include/hal_util.h
index 615c960..c8803c2 100644
--- a/system/btcore/include/hal_util.h
+++ b/system/btcore/include/hal_util.h
@@ -19,5 +19,5 @@
#include <hardware/bluetooth.h>
// Loads the Bluetooth library. This function looks explicitly for
-// libbluetooth.default.so and loads it.
+// libbluetooth.so and loads it.
int hal_util_load_bt_library(const bt_interface_t** interface);
diff --git a/system/btcore/src/hal_util.cc b/system/btcore/src/hal_util.cc
index ece06a3..a89e5ea 100644
--- a/system/btcore/src/hal_util.cc
+++ b/system/btcore/src/hal_util.cc
@@ -29,33 +29,19 @@
using base::StringPrintf;
-#define BLUETOOTH_LIBRARY_NAME "bluetooth.default.so"
-#if defined(__LP64__)
-#define BACKUP_PATH "/system/lib64/hw/" BLUETOOTH_LIBRARY_NAME
-#else
-#define BACKUP_PATH "/system/lib/hw/" BLUETOOTH_LIBRARY_NAME
-#endif
+#define BLUETOOTH_LIBRARY_NAME "libbluetooth.so"
int hal_util_load_bt_library(const bt_interface_t** interface) {
const char* sym = BLUETOOTH_INTERFACE_STRING;
bt_interface_t* itf = nullptr;
// Always try to load the default Bluetooth stack on GN builds.
- const char* path = BLUETOOTH_LIBRARY_NAME;
- void* handle = dlopen(path, RTLD_NOW);
+ void* handle = dlopen(BLUETOOTH_LIBRARY_NAME, RTLD_NOW);
if (!handle) {
const char* err_str = dlerror();
- LOG(WARNING) << __func__ << ": failed to load Bluetooth library " << path
- << ", error=" << (err_str ? err_str : "error unknown");
- path = BACKUP_PATH;
- LOG(WARNING) << __func__ << ": loading backup path " << path;
- handle = dlopen(path, RTLD_NOW);
- if (!handle) {
- err_str = dlerror();
- LOG(ERROR) << __func__ << ": failed to load Bluetooth library " << path
- << ", error=" << (err_str ? err_str : "error unknown");
- goto error;
- }
+ LOG(ERROR) << __func__ << ": failed to load bluetooth library, error="
+ << (err_str ? err_str : "error unknown");
+ goto error;
}
// Get the address of the bt_interface_t.
diff --git a/system/btif/Android.bp b/system/btif/Android.bp
index 2bb333a..f5e6404 100644
--- a/system/btif/Android.bp
+++ b/system/btif/Android.bp
@@ -107,7 +107,7 @@
defaults: ["fluoride_defaults"],
include_dirs: btifCommonIncludes,
srcs: ["test/btif_storage_test.cc"],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
shared_libs: [
"liblog",
"libcutils",
@@ -132,7 +132,7 @@
"src/btif_profile_queue.cc",
"test/btif_profile_queue_test.cc"
],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
shared_libs: [
"liblog",
"libcutils",
diff --git a/system/build/Android.bp b/system/build/Android.bp
index 4077365..53d461d 100644
--- a/system/build/Android.bp
+++ b/system/build/Android.bp
@@ -46,7 +46,7 @@
fluoride_defaults {
name: "fluoride_defaults",
defaults: ["fluoride_types_defaults"],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
static_libs: [
"libbluetooth-types",
],
diff --git a/system/include/Android.bp b/system/include/Android.bp
index d358baa..fc7b6ca 100644
--- a/system/include/Android.bp
+++ b/system/include/Android.bp
@@ -1,5 +1,5 @@
cc_library_headers {
- name: "bluetooth.default_headers",
+ name: "libbluetooth_headers",
header_libs: [
"libbluetooth-types-header",
],
diff --git a/system/main/Android.bp b/system/main/Android.bp
index 833b10f..38e8b05 100644
--- a/system/main/Android.bp
+++ b/system/main/Android.bp
@@ -2,11 +2,10 @@
// Bluetooth main HW module / shared library for target
// ========================================================
cc_library_shared {
- name: "bluetooth.default",
+ name: "libbluetooth",
defaults: ["fluoride_defaults"],
- relative_install_path: "hw",
- header_libs: ["bluetooth.default_headers"],
- export_header_lib_headers: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
+ export_header_lib_headers: ["libbluetooth_headers"],
srcs: [
// platform specific
"bte_conf.cc",
diff --git a/system/service/Android.bp b/system/service/Android.bp
index 1a17b69..efb3558 100644
--- a/system/service/Android.bp
+++ b/system/service/Android.bp
@@ -8,7 +8,7 @@
include_dirs: [
"packages/modules/Bluetooth/system",
],
- header_libs: [ "bluetooth.default_headers" ],
+ header_libs: [ "libbluetooth_headers" ],
}
// Source variables
@@ -71,7 +71,7 @@
btserviceLinuxSrc +
btserviceDaemonSrc +
["main.cc"],
- required: ["bluetooth.default"],
+ required: ["libbluetooth-system"],
static_libs: [
"libbluetooth-binder-common",
"libbtcore",
@@ -184,7 +184,7 @@
name: "libbluetoothtbd_hal",
defaults: ["fluoride_defaults"],
include_dirs: ["packages/modules/Bluetooth/system"],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
srcs: [
"hal/bluetooth_gatt_interface.cc",
"hal/bluetooth_interface.cc",
diff --git a/system/service/common/Android.bp b/system/service/common/Android.bp
index bd08d9b..025f298 100644
--- a/system/service/common/Android.bp
+++ b/system/service/common/Android.bp
@@ -7,7 +7,7 @@
"-fvisibility=default",
],
host_supported: true,
- header_libs: [ "bluetooth.default_headers" ],
+ header_libs: [ "libbluetooth_headers" ],
srcs: [
"bluetooth/adapter_state.cc",
"bluetooth/advertise_data.cc",
@@ -35,7 +35,7 @@
/* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
"-fvisibility=default",
],
- header_libs: [ "bluetooth.default_headers" ],
+ header_libs: [ "libbluetooth_headers" ],
srcs: [
"android/bluetooth/IBluetooth.aidl",
"android/bluetooth/IBluetoothCallback.aidl",
diff --git a/system/stack/Android.bp b/system/stack/Android.bp
index 477dd15..64c2707 100644
--- a/system/stack/Android.bp
+++ b/system/stack/Android.bp
@@ -20,7 +20,7 @@
"srvc",
],
header_libs: [
- "bluetooth.default_headers",
+ "libbluetooth_headers",
],
include_dirs: [
"external/aac/libAACenc/include",
diff --git a/system/test/rootcanal/Android.bp b/system/test/rootcanal/Android.bp
index 420629f..a1d2379 100644
--- a/system/test/rootcanal/Android.bp
+++ b/system/test/rootcanal/Android.bp
@@ -22,7 +22,7 @@
"service.cc",
],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
shared_libs: [
"android.hardware.bluetooth@1.0",
"libbase",
@@ -64,7 +64,7 @@
"bluetooth_hci.cc",
],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
shared_libs: [
"android.hardware.bluetooth@1.0",
"libbase",
diff --git a/system/vendor_libs/linux/interface/Android.bp b/system/vendor_libs/linux/interface/Android.bp
index 616de7d..d4bf207 100644
--- a/system/vendor_libs/linux/interface/Android.bp
+++ b/system/vendor_libs/linux/interface/Android.bp
@@ -25,7 +25,7 @@
"service.cc"
],
cflags: ["-Wall", "-Werror"],
- header_libs: ["bluetooth.default_headers"],
+ header_libs: ["libbluetooth_headers"],
shared_libs: [
"android.hardware.bluetooth@1.0",
"libbase",
diff --git a/system/vendor_libs/test_vendor_lib/Android.bp b/system/vendor_libs/test_vendor_lib/Android.bp
index 2186f4b..39b3c5f 100644
--- a/system/vendor_libs/test_vendor_lib/Android.bp
+++ b/system/vendor_libs/test_vendor_lib/Android.bp
@@ -38,7 +38,7 @@
],
export_include_dirs: ["include"],
header_libs: [
- "bluetooth.default_headers",
+ "libbluetooth_headers",
],
include_dirs: [
"packages/modules/Bluetooth/system",