Loading TEST_MAPPING +4 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,10 @@ { "name" : "net_test_stack_gatt_native", "host" : true }, { "name" : "net_test_stack_a2dp_native", "host" : true } ] } apex/Android.bp +0 −1 Original line number Diff line number Diff line apex { name: "com.android.bluetooth.updatable", updatable: true, min_sdk_version: "R", manifest: "apex_manifest.json", Loading system/stack/Android.bp +33 −0 Original line number Diff line number Diff line Loading @@ -502,3 +502,36 @@ cc_test { misc_undefined: ["bounds"], }, } cc_test { name: "net_test_stack_a2dp_native", defaults: ["fluoride_defaults"], test_suites: ["device-tests"], host_supported: true, include_dirs: [ "external/libldac/inc", "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/stack/include", ], srcs: [ "test/a2dp/a2dp_vendor_ldac_decoder_test.cc", "test/a2dp/misc_fake.cc", ], shared_libs: [ "libcrypto", "libcutils", "libprotobuf-cpp-lite", ], static_libs: [ "libbt-common", "libbt-protos-lite", "liblog", "libosi", "libosi-AllocationTestHarness", ], sanitize: { address: true, cfi: true, misc_undefined: ["bounds"], }, } system/stack/a2dp/a2dp_vendor_ldac_decoder.cc +13 −1 Original line number Diff line number Diff line Loading @@ -203,11 +203,23 @@ void a2dp_vendor_ldac_decoder_cleanup(void) { } bool a2dp_vendor_ldac_decoder_decode_packet(BT_HDR* p_buf) { pthread_mutex_lock(&(a2dp_ldac_decoder_cb.mutex)); if (p_buf == nullptr) { LOG(ERROR) << __func__ << "Dropping packet with nullptr"; return false; } unsigned char* pBuffer = reinterpret_cast<unsigned char*>(p_buf->data + p_buf->offset); // unsigned int bufferSize = p_buf->len; unsigned int bytesValid = p_buf->len; if (bytesValid == 0) { LOG(WARNING) << __func__ << "Dropping packet with zero length"; return false; } pthread_mutex_lock(&(a2dp_ldac_decoder_cb.mutex)); LDACBT_SMPL_FMT_T fmt; int bs_bytes, frame_number; Loading system/stack/include/ldacBT_bco_for_fluoride.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ extern "C" { #endif /* LDAC_BCO_API */ /* This file contains the definitions, declarations and macros for an * implimentation of LDAC buffer control operation. * implementation of LDAC buffer control operation. */ #define LDAC_BCO_ERR_NONE 0 Loading Loading
TEST_MAPPING +4 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,10 @@ { "name" : "net_test_stack_gatt_native", "host" : true }, { "name" : "net_test_stack_a2dp_native", "host" : true } ] }
apex/Android.bp +0 −1 Original line number Diff line number Diff line apex { name: "com.android.bluetooth.updatable", updatable: true, min_sdk_version: "R", manifest: "apex_manifest.json", Loading
system/stack/Android.bp +33 −0 Original line number Diff line number Diff line Loading @@ -502,3 +502,36 @@ cc_test { misc_undefined: ["bounds"], }, } cc_test { name: "net_test_stack_a2dp_native", defaults: ["fluoride_defaults"], test_suites: ["device-tests"], host_supported: true, include_dirs: [ "external/libldac/inc", "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/stack/include", ], srcs: [ "test/a2dp/a2dp_vendor_ldac_decoder_test.cc", "test/a2dp/misc_fake.cc", ], shared_libs: [ "libcrypto", "libcutils", "libprotobuf-cpp-lite", ], static_libs: [ "libbt-common", "libbt-protos-lite", "liblog", "libosi", "libosi-AllocationTestHarness", ], sanitize: { address: true, cfi: true, misc_undefined: ["bounds"], }, }
system/stack/a2dp/a2dp_vendor_ldac_decoder.cc +13 −1 Original line number Diff line number Diff line Loading @@ -203,11 +203,23 @@ void a2dp_vendor_ldac_decoder_cleanup(void) { } bool a2dp_vendor_ldac_decoder_decode_packet(BT_HDR* p_buf) { pthread_mutex_lock(&(a2dp_ldac_decoder_cb.mutex)); if (p_buf == nullptr) { LOG(ERROR) << __func__ << "Dropping packet with nullptr"; return false; } unsigned char* pBuffer = reinterpret_cast<unsigned char*>(p_buf->data + p_buf->offset); // unsigned int bufferSize = p_buf->len; unsigned int bytesValid = p_buf->len; if (bytesValid == 0) { LOG(WARNING) << __func__ << "Dropping packet with zero length"; return false; } pthread_mutex_lock(&(a2dp_ldac_decoder_cb.mutex)); LDACBT_SMPL_FMT_T fmt; int bs_bytes, frame_number; Loading
system/stack/include/ldacBT_bco_for_fluoride.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ extern "C" { #endif /* LDAC_BCO_API */ /* This file contains the definitions, declarations and macros for an * implimentation of LDAC buffer control operation. * implementation of LDAC buffer control operation. */ #define LDAC_BCO_ERR_NONE 0 Loading