Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5496e7ed authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

hw/bluetooth.default.so -> libbluetooth.so (1/2)

am: a75a654c

Change-Id: I180079583d6f057827fad7f98e459c8e67ad931d
parents 61bd4eb1 a75a654c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ cc_defaults {
    shared_libs: [
        "libcutils",
    ],
    header_libs: ["bluetooth.default_headers"],
    header_libs: ["libbluetooth_headers"],
    cflags: ["-DBUILDCFG"],
}

+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ cc_library_static {
    shared_libs: [
        "liblog",
    ],
    header_libs: ["bluetooth.default_headers"],
    header_libs: ["libbluetooth_headers"],
    host_supported: true,
    target: {
        darwin: {
+1 −1
Original line number Diff line number Diff line
@@ -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);
+5 −19
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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",
@@ -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