diff --git a/system/btif/Android.bp b/system/btif/Android.bp index 24ef39c4e64732fa9b8e705f9f541d57f2fa6cd0..5095311745f39800d17e0da05b7a22eb5dd6ea10 100755 --- a/system/btif/Android.bp +++ b/system/btif/Android.bp @@ -118,9 +118,6 @@ cc_library_static { "libaaudio", "libfmq", ], - whole_static_libs: [ - "libbt-audio-hal-interface", - ], srcs: ["src/btif_avrcp_audio_track.cc"], }, host: { @@ -130,6 +127,7 @@ cc_library_static { whole_static_libs: [ "avrcp-target-service", "lib-bt-packets", + "libbt-audio-hal-interface", "libaudio-a2dp-hw-utils", ], cflags: [ diff --git a/system/btif/src/btif_debug_btsnoop.cc b/system/btif/src/btif_debug_btsnoop.cc index e72a87519bae27cc79567c0e5f098ef3fd35fbd6..5ebfdae7bd51e82eb8b45ef986ea147f680794e3 100644 --- a/system/btif/src/btif_debug_btsnoop.cc +++ b/system/btif/src/btif_debug_btsnoop.cc @@ -35,12 +35,6 @@ static const size_t BTSNOOP_MEM_BUFFER_SIZE = (256 * 1024); #endif -// Block size for copying buffers (for compression/encoding etc.) -static const size_t BLOCK_SIZE = 16384; - -// Maximum line length in bugreport (should be multiple of 4 for base64 output) -static const uint8_t MAX_LINE_LENGTH = 128; - static std::mutex buffer_mutex; static ringbuffer_t* buffer = NULL; static uint64_t last_timestamp_ms = 0; @@ -134,6 +128,18 @@ static size_t btsnoop_calculate_packet_length(uint16_t type, } } +void btif_debug_btsnoop_init(void) { + if (buffer == NULL) buffer = ringbuffer_init(BTSNOOP_MEM_BUFFER_SIZE); + btsnoop_mem_set_callback(btsnoop_cb); +} + +#ifndef OS_ANDROID +void btif_debug_btsnoop_dump(int fd) {} +#else + +// Block size for copying buffers (for compression/encoding etc.) +static constexpr size_t BLOCK_SIZE = 16384; + static bool btsnoop_compress(ringbuffer_t* rb_dst, ringbuffer_t* rb_src) { CHECK(rb_dst != NULL); CHECK(rb_src != NULL); @@ -175,11 +181,6 @@ static bool btsnoop_compress(ringbuffer_t* rb_dst, ringbuffer_t* rb_src) { return rc; } -void btif_debug_btsnoop_init(void) { - if (buffer == NULL) buffer = ringbuffer_init(BTSNOOP_MEM_BUFFER_SIZE); - btsnoop_mem_set_callback(btsnoop_cb); -} - void btif_debug_btsnoop_dump(int fd) { ringbuffer_t* ringbuffer = ringbuffer_init(BTSNOOP_MEM_BUFFER_SIZE); if (ringbuffer == NULL) { @@ -219,6 +220,9 @@ void btif_debug_btsnoop_dump(int fd) { while (ringbuffer_size(ringbuffer) > 0) { size_t read = ringbuffer_pop(ringbuffer, b64_in, 3); + // Maximum line length in bugreport (should be multiple of 4 for base64 + // output) + constexpr uint8_t MAX_LINE_LENGTH = 128; if (line_length >= MAX_LINE_LENGTH) { dprintf(fd, "\n"); line_length = 0; @@ -232,3 +236,4 @@ void btif_debug_btsnoop_dump(int fd) { error: ringbuffer_free(ringbuffer); } +#endif diff --git a/system/gd/btaa/host/activity_attribution.cc b/system/gd/btaa/host/activity_attribution.cc index a29aaacdbfea8582fe63eecbb3ec44f82d218451..e9f41344007396316ce96ffd3291a06f52c7ffe1 100644 --- a/system/gd/btaa/host/activity_attribution.cc +++ b/system/gd/btaa/host/activity_attribution.cc @@ -36,5 +36,7 @@ void ActivityAttribution::Start() {} void ActivityAttribution::Stop() {} +const ModuleFactory ActivityAttribution::Factory = ModuleFactory([]() { return new ActivityAttribution(); }); + } // namespace activity_attribution } // namespace bluetooth diff --git a/system/main/Android.bp b/system/main/Android.bp index b9fa910447d01fac941ce7696f231b9970b76116..864202837aff7b8a05416faf62aad92ff64d022b 100644 --- a/system/main/Android.bp +++ b/system/main/Android.bp @@ -99,14 +99,10 @@ cc_library_shared { "android.hardware.bluetooth.audio@2.1", "android.hardware.bluetooth@1.0", "android.hardware.bluetooth@1.1", - "android.system.suspend.control-V1-ndk", - "libaaudio", "libbinder_ndk", "libcrypto", "libcutils", - "libdl", "libflatbuffers-cpp", - "libfmq", "libhidlbase", "liblog", "libprocessgroup", @@ -137,6 +133,19 @@ cc_library_shared { "libosi", "libbt-protos-lite", ], + target: { + android: { + shared_libs: [ + "android.system.suspend.control-V1-ndk", + "libaaudio", + "libfmq", + ], + required: [ + "libldacBT_enc", + "libldacBT_abr", + ], + }, + }, // Shared library link options. // References to global symbols and functions should bind to the library // itself. This is to avoid issues with some of the unit/system tests @@ -146,15 +155,14 @@ cc_library_shared { required: [ "bt_did.conf", "bt_stack.conf", - "libldacBT_enc", - "libldacBT_abr", ], cflags: [ "-DBUILDCFG", ], sanitize: { - scs: true, + never: true, }, + host_supported: true, } cc_library_static {