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

Commit 81e644e9 authored by Zach Johnson's avatar Zach Johnson Committed by William Escande
Browse files

check check, is anyone there? *static*

* statically link libbluetooth into libbluetooth_jni
* clean up some build rule defaults
* statically link libchrome
* stop using whole static libs, to increase ability to prune unused code

:party:
:party:

Still some issue on local test. I suppose they should only be run in
the test suite. Test are:
* bluetooth-test-audio-hal-interface
* bluetooth_flatbuffer_bundler_test
* net_test_rfcomm_suite
* net_test_stack_rfcomm

Bug: 220805766
Test: compile, verify BT boots & basic use cases work
Testeted with all cc_test in packages/modules/Bluetooth:
atest $(grep -w cc_test -A 1 $(find packages/modules/Bluetooth -name Android.bp) | grep name | cut -d '"' -f 2)
Test: m bluetoothtbd
Test: atest bluetoothtbd_test

Ignore-AOSP-First: apex changes not in AOSP yet

Change-Id: I0d232c8bcbe1f9065c6e6caa75021a6cd627c78f
parent 0be69f73
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ java_library {

cc_library_shared {
    name: "libbluetooth_jni",
    defaults: ["fluoride_full_defaults"],
    srcs: ["jni/**/*.cpp"],
    header_libs: [
        "jni_headers",
@@ -60,14 +61,9 @@ cc_library_shared {
    include_dirs: [
        "packages/modules/Bluetooth/system/types",
    ],
    shared_libs: [
        "libbase",
        "libchrome",
        "liblog",
        "libnativehelper",
    ],
    static_libs: [
        "libbluetooth-types",
        "libbluetooth",
    ],
    cflags: [
        "-Wall",
@@ -78,9 +74,6 @@ cc_library_shared {
    sanitize: {
        scs: true,
    },
    apex_available: [
        "com.android.bluetooth",
    ],
    min_sdk_version: "current",
}

+0 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

#define LOG_TAG "BluetoothA2dpServiceJni"

#define LOG_NDEBUG 0

#include "com_android_bluetooth.h"
#include "hardware/bt_av.h"
#include "utils/Log.h"
+0 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

#define LOG_TAG "BluetoothA2dpSinkServiceJni"

#define LOG_NDEBUG 0

#include "com_android_bluetooth.h"
#include "hardware/bt_av.h"
#include "utils/Log.h"
+0 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

#define LOG_TAG "BluetoothAvrcpControllerJni"

#define LOG_NDEBUG 0

#include "com_android_bluetooth.h"
#include "hardware/bt_rc.h"
#include "utils/Log.h"
+8 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@
#include <pthread.h>

using bluetooth::Uuid;
#ifndef DYNAMIC_LOAD_BLUETOOTH
extern bt_interface_t bluetoothInterface;
#endif

namespace android {
// Both
@@ -846,6 +849,10 @@ static bt_os_callouts_t sBluetoothOsCallouts = {
};

int hal_util_load_bt_library(const bt_interface_t** interface) {
#ifndef DYNAMIC_LOAD_BLUETOOTH
  *interface = &bluetoothInterface;
  return 0;
#else
  const char* sym = BLUETOOTH_INTERFACE_STRING;
  bt_interface_t* itf = nullptr;

@@ -875,6 +882,7 @@ error:
  if (handle) dlclose(handle);

  return -EINVAL;
#endif
}

static void classInitNative(JNIEnv* env, jclass clazz) {
Loading