Loading system/bta/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,9 @@ cc_library_static { "libcom.android.sysprop.bluetooth.wrapped", "liblc3", ], shared_libs: [ "libcrypto", ], generated_headers: [ "LeAudioSetConfigSchemas_h", ], Loading Loading @@ -220,6 +223,9 @@ cc_library_static { "libflatbuffers-cpp", "server_configurable_flags", ], shared_libs: [ "libcrypto", ], apex_available: [ "com.android.btservices", ], Loading system/bta/gatt/bta_gattc_api.cc +7 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <vector> #include "bta/gatt/bta_gattc_int.h" #include "gd/hci/uuid.h" #include "gd/os/rand.h" #include "os/log.h" #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" Loading Loading @@ -84,9 +86,12 @@ void BTA_GATTC_AppRegister(tBTA_GATTC_CBACK* p_client_cb, bta_sys_register(BTA_ID_GATTC, &bta_gattc_reg); } Uuid uuid = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); do_in_main_thread(FROM_HERE, base::BindOnce(&bta_gattc_register, Uuid::GetRandom(), p_client_cb, std::move(cb), eatt_support)); base::BindOnce(&bta_gattc_register, uuid, p_client_cb, std::move(cb), eatt_support)); } static void app_deregister_impl(tGATT_IF client_if) { Loading system/bta/groups/groups_test.cc +13 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <gtest/gtest.h> #include "bta_groups.h" #include "gd/os/rand.h" #include "test/common/mock_functions.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" Loading Loading @@ -169,8 +170,10 @@ TEST_F(GroupsTest, test_add_multiple_groups) { } TEST_F(GroupsTest, test_remove_multiple_groups) { Uuid uuid1 = Uuid::GetRandom(); Uuid uuid2 = Uuid::GetRandom(); Uuid uuid1 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); Uuid uuid2 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); ASSERT_NE(uuid1, uuid2); EXPECT_CALL(*callbacks, OnGroupAdded(_, _, _)).Times(2); Loading @@ -189,8 +192,10 @@ TEST_F(GroupsTest, test_remove_multiple_groups) { } TEST_F(GroupsTest, test_remove_device_fo_devices) { Uuid uuid1 = Uuid::GetRandom(); Uuid uuid2 = Uuid::GetRandom(); Uuid uuid1 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); Uuid uuid2 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); EXPECT_CALL(*callbacks, OnGroupAdded(_, _, _)).Times(2); DeviceGroups::Initialize(callbacks.get()); DeviceGroups::Get()->AddDevice(GetTestAddress(1), uuid1, 8); Loading Loading @@ -270,8 +275,10 @@ TEST_F(GroupsTest, test_storage_calls) { TEST_F(GroupsTest, test_storage_content) { int gid1 = bluetooth::groups::kGroupUnknown; int gid2 = bluetooth::groups::kGroupUnknown; Uuid uuid1 = Uuid::GetRandom(); Uuid uuid2 = Uuid::GetRandom(); Uuid uuid1 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); Uuid uuid2 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); ASSERT_NE(uuid1, uuid2); DeviceGroups::Initialize(callbacks.get()); Loading system/bta/ras/ras_server.cc +5 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ #include "bta/include/bta_gatt_api.h" #include "bta/include/bta_ras_api.h" #include "bta/ras/ras_types.h" #include "gd/hci/uuid.h" #include "gd/os/rand.h" #include "os/logging/log_adapter.h" #include "stack/include/bt_types.h" #include "stack/include/btm_ble_addr.h" Loading Loading @@ -71,7 +73,9 @@ class RasServerImpl : public bluetooth::ras::RasServer { }; void Initialize() { app_uuid_ = bluetooth::Uuid::GetRandom(); Uuid uuid = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); app_uuid_ = uuid; log::info("Register server with uuid:{}", app_uuid_.ToString()); BTA_GATTS_AppRegister( Loading system/btif/include/btif_sock_l2cap.h +4 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ bt_status_t btsock_l2cap_connect(const RawAddress* bd_addr, int channel, void btsock_l2cap_signaled(int fd, int flags, uint32_t user_id); void on_l2cap_psm_assigned(int id, int psm); bt_status_t btsock_l2cap_disconnect(const RawAddress* bd_addr); bt_status_t btsock_l2cap_get_l2cap_local_cid(Uuid& conn_uuid, uint16_t* cid); bt_status_t btsock_l2cap_get_l2cap_remote_cid(Uuid& conn_uuid, uint16_t* cid); bt_status_t btsock_l2cap_get_l2cap_local_cid(bluetooth::Uuid& conn_uuid, uint16_t* cid); bt_status_t btsock_l2cap_get_l2cap_remote_cid(bluetooth::Uuid& conn_uuid, uint16_t* cid); #endif Loading
system/bta/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,9 @@ cc_library_static { "libcom.android.sysprop.bluetooth.wrapped", "liblc3", ], shared_libs: [ "libcrypto", ], generated_headers: [ "LeAudioSetConfigSchemas_h", ], Loading Loading @@ -220,6 +223,9 @@ cc_library_static { "libflatbuffers-cpp", "server_configurable_flags", ], shared_libs: [ "libcrypto", ], apex_available: [ "com.android.btservices", ], Loading
system/bta/gatt/bta_gattc_api.cc +7 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <vector> #include "bta/gatt/bta_gattc_int.h" #include "gd/hci/uuid.h" #include "gd/os/rand.h" #include "os/log.h" #include "osi/include/allocator.h" #include "stack/include/bt_hdr.h" Loading Loading @@ -84,9 +86,12 @@ void BTA_GATTC_AppRegister(tBTA_GATTC_CBACK* p_client_cb, bta_sys_register(BTA_ID_GATTC, &bta_gattc_reg); } Uuid uuid = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); do_in_main_thread(FROM_HERE, base::BindOnce(&bta_gattc_register, Uuid::GetRandom(), p_client_cb, std::move(cb), eatt_support)); base::BindOnce(&bta_gattc_register, uuid, p_client_cb, std::move(cb), eatt_support)); } static void app_deregister_impl(tGATT_IF client_if) { Loading
system/bta/groups/groups_test.cc +13 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <gtest/gtest.h> #include "bta_groups.h" #include "gd/os/rand.h" #include "test/common/mock_functions.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" Loading Loading @@ -169,8 +170,10 @@ TEST_F(GroupsTest, test_add_multiple_groups) { } TEST_F(GroupsTest, test_remove_multiple_groups) { Uuid uuid1 = Uuid::GetRandom(); Uuid uuid2 = Uuid::GetRandom(); Uuid uuid1 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); Uuid uuid2 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); ASSERT_NE(uuid1, uuid2); EXPECT_CALL(*callbacks, OnGroupAdded(_, _, _)).Times(2); Loading @@ -189,8 +192,10 @@ TEST_F(GroupsTest, test_remove_multiple_groups) { } TEST_F(GroupsTest, test_remove_device_fo_devices) { Uuid uuid1 = Uuid::GetRandom(); Uuid uuid2 = Uuid::GetRandom(); Uuid uuid1 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); Uuid uuid2 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); EXPECT_CALL(*callbacks, OnGroupAdded(_, _, _)).Times(2); DeviceGroups::Initialize(callbacks.get()); DeviceGroups::Get()->AddDevice(GetTestAddress(1), uuid1, 8); Loading Loading @@ -270,8 +275,10 @@ TEST_F(GroupsTest, test_storage_calls) { TEST_F(GroupsTest, test_storage_content) { int gid1 = bluetooth::groups::kGroupUnknown; int gid2 = bluetooth::groups::kGroupUnknown; Uuid uuid1 = Uuid::GetRandom(); Uuid uuid2 = Uuid::GetRandom(); Uuid uuid1 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); Uuid uuid2 = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); ASSERT_NE(uuid1, uuid2); DeviceGroups::Initialize(callbacks.get()); Loading
system/bta/ras/ras_server.cc +5 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ #include "bta/include/bta_gatt_api.h" #include "bta/include/bta_ras_api.h" #include "bta/ras/ras_types.h" #include "gd/hci/uuid.h" #include "gd/os/rand.h" #include "os/logging/log_adapter.h" #include "stack/include/bt_types.h" #include "stack/include/btm_ble_addr.h" Loading Loading @@ -71,7 +73,9 @@ class RasServerImpl : public bluetooth::ras::RasServer { }; void Initialize() { app_uuid_ = bluetooth::Uuid::GetRandom(); Uuid uuid = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>()); app_uuid_ = uuid; log::info("Register server with uuid:{}", app_uuid_.ToString()); BTA_GATTS_AppRegister( Loading
system/btif/include/btif_sock_l2cap.h +4 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ bt_status_t btsock_l2cap_connect(const RawAddress* bd_addr, int channel, void btsock_l2cap_signaled(int fd, int flags, uint32_t user_id); void on_l2cap_psm_assigned(int id, int psm); bt_status_t btsock_l2cap_disconnect(const RawAddress* bd_addr); bt_status_t btsock_l2cap_get_l2cap_local_cid(Uuid& conn_uuid, uint16_t* cid); bt_status_t btsock_l2cap_get_l2cap_remote_cid(Uuid& conn_uuid, uint16_t* cid); bt_status_t btsock_l2cap_get_l2cap_local_cid(bluetooth::Uuid& conn_uuid, uint16_t* cid); bt_status_t btsock_l2cap_get_l2cap_remote_cid(bluetooth::Uuid& conn_uuid, uint16_t* cid); #endif