Loading system/bta/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ cc_defaults { shared_libs: [ "libcutils", ], header_libs: ["bluetooth.default_headers"], header_libs: ["libbluetooth_headers"], cflags: ["-DBUILDCFG"], } Loading system/btcore/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ cc_library_static { shared_libs: [ "liblog", ], header_libs: ["bluetooth.default_headers"], header_libs: ["libbluetooth_headers"], host_supported: true, target: { darwin: { Loading system/btcore/include/hal_util.h +1 −1 Original line number Diff line number Diff line Loading @@ -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); system/btcore/src/hal_util.cc +5 −19 Original line number Diff line number Diff line Loading @@ -29,34 +29,20 @@ 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"); 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. itf = (bt_interface_t*)dlsym(handle, sym); Loading system/btif/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ cc_test { 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", Loading @@ -132,7 +132,7 @@ cc_test { "src/btif_profile_queue.cc", "test/btif_profile_queue_test.cc" ], header_libs: ["bluetooth.default_headers"], header_libs: ["libbluetooth_headers"], shared_libs: [ "liblog", "libcutils", Loading Loading
system/bta/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ cc_defaults { shared_libs: [ "libcutils", ], header_libs: ["bluetooth.default_headers"], header_libs: ["libbluetooth_headers"], cflags: ["-DBUILDCFG"], } Loading
system/btcore/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ cc_library_static { shared_libs: [ "liblog", ], header_libs: ["bluetooth.default_headers"], header_libs: ["libbluetooth_headers"], host_supported: true, target: { darwin: { Loading
system/btcore/include/hal_util.h +1 −1 Original line number Diff line number Diff line Loading @@ -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);
system/btcore/src/hal_util.cc +5 −19 Original line number Diff line number Diff line Loading @@ -29,34 +29,20 @@ 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"); 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. itf = (bt_interface_t*)dlsym(handle, sym); Loading
system/btif/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ cc_test { 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", Loading @@ -132,7 +132,7 @@ cc_test { "src/btif_profile_queue.cc", "test/btif_profile_queue_test.cc" ], header_libs: ["bluetooth.default_headers"], header_libs: ["libbluetooth_headers"], shared_libs: [ "liblog", "libcutils", Loading