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

Commit 802bfa8a authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove ability to change libbluetooth.so path

Can't use libcutils in ndk, plus changing the path
doesn't make sense in an updatable world.

Bug: 143971120
Test: compile, boot, and check that basic functionality is working
Change-Id: I0b25a0971e976c41bb4ac9a809bba8ded31dc3ff
parent bec5b1c5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ cc_library_shared {
    ],
    static_libs: [
        "libbluetooth-types",
        "libcutils",
    ],
    cflags: [
        "-Wall",
+1 −7
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include "utils/Log.h"
#include "utils/misc.h"

#include <cutils/properties.h>
#include <dlfcn.h>
#include <errno.h>
#include <pthread.h>
@@ -598,17 +597,12 @@ static bt_os_callouts_t sBluetoothOsCallouts = {
    acquire_wake_lock_callout, release_wake_lock_callout,
};

#define PROPERTY_BT_LIBRARY_NAME "ro.bluetooth.library_name"
#define DEFAULT_BT_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;

  // The library name is not set by default, so the preset library name is used.
  char path[PROPERTY_VALUE_MAX] = "";
  property_get(PROPERTY_BT_LIBRARY_NAME, path, DEFAULT_BT_LIBRARY_NAME);
  void* handle = dlopen(path, RTLD_NOW);
  void* handle = dlopen("libbluetooth.so", RTLD_NOW);
  if (!handle) {
    const char* err_str = dlerror();
    ALOGE("%s: failed to load Bluetooth library, error=%s", __func__,