Loading system/btcore/src/hal_util.cc +0 −39 Original line number Diff line number Diff line Loading @@ -29,44 +29,6 @@ using base::StringPrintf; #define BLUETOOTH_LIBRARY_NAME "libbluetooth.so" #if !defined(STATIC_LIBBLUETOOTH) 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. void* handle = dlopen(BLUETOOTH_LIBRARY_NAME, RTLD_NOW); if (!handle) { const char* err_str = dlerror(); 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); if (!itf) { LOG(ERROR) << __func__ << ": failed to load symbol from Bluetooth library " << sym; goto error; } // Success. LOG(INFO) << __func__ << " loaded HAL path=" << BLUETOOTH_LIBRARY_NAME << " btinterface=" << itf << " handle=" << handle; *interface = itf; return 0; error: *interface = NULL; if (handle) dlclose(handle); return -EINVAL; } #else extern bt_interface_t bluetoothInterface; int hal_util_load_bt_library(const bt_interface_t** interface) { Loading @@ -74,4 +36,3 @@ int hal_util_load_bt_library(const bt_interface_t** interface) { return 0; } #endif system/btif/test/btif_core_test.cc +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <map> #include "bta/include/bta_ag_api.h" #include "btcore/include/module.h" #include "btif/include/btif_api.h" #include "btif/include/btif_common.h" #include "types/raw_address.h" Loading @@ -32,6 +33,12 @@ uint8_t btu_trace_level = BT_TRACE_LEVEL_DEBUG; const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {}; module_t bt_utils_module; module_t gd_controller_module; module_t gd_idle_module; module_t gd_shim_module; module_t osi_module; namespace { auto timeout_time = std::chrono::seconds(3); Loading Loading
system/btcore/src/hal_util.cc +0 −39 Original line number Diff line number Diff line Loading @@ -29,44 +29,6 @@ using base::StringPrintf; #define BLUETOOTH_LIBRARY_NAME "libbluetooth.so" #if !defined(STATIC_LIBBLUETOOTH) 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. void* handle = dlopen(BLUETOOTH_LIBRARY_NAME, RTLD_NOW); if (!handle) { const char* err_str = dlerror(); 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); if (!itf) { LOG(ERROR) << __func__ << ": failed to load symbol from Bluetooth library " << sym; goto error; } // Success. LOG(INFO) << __func__ << " loaded HAL path=" << BLUETOOTH_LIBRARY_NAME << " btinterface=" << itf << " handle=" << handle; *interface = itf; return 0; error: *interface = NULL; if (handle) dlclose(handle); return -EINVAL; } #else extern bt_interface_t bluetoothInterface; int hal_util_load_bt_library(const bt_interface_t** interface) { Loading @@ -74,4 +36,3 @@ int hal_util_load_bt_library(const bt_interface_t** interface) { return 0; } #endif
system/btif/test/btif_core_test.cc +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <map> #include "bta/include/bta_ag_api.h" #include "btcore/include/module.h" #include "btif/include/btif_api.h" #include "btif/include/btif_common.h" #include "types/raw_address.h" Loading @@ -32,6 +33,12 @@ uint8_t btu_trace_level = BT_TRACE_LEVEL_DEBUG; const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {}; module_t bt_utils_module; module_t gd_controller_module; module_t gd_idle_module; module_t gd_shim_module; module_t osi_module; namespace { auto timeout_time = std::chrono::seconds(3); Loading