Loading system/bta/ag/bta_ag_main.cc +2 −2 Original line number Diff line number Diff line Loading @@ -564,8 +564,8 @@ void bta_ag_resume_open(tBTA_AG_SCB* p_scb) { if (p_scb->state == BTA_AG_INIT_ST) { LOG(INFO) << __func__ << ": Resume connection to " << p_scb->peer_addr << ", handle" << bta_ag_scb_to_idx(p_scb); tBTA_AG_DATA open_data = {.api_open.bd_addr = p_scb->peer_addr, .api_open.sec_mask = p_scb->cli_sec_mask}; tBTA_AG_DATA open_data = {.api_open = {.bd_addr = p_scb->peer_addr, .sec_mask = p_scb->cli_sec_mask}}; bta_ag_sm_execute(p_scb, BTA_AG_API_OPEN_EVT, open_data); } else { VLOG(1) << __func__ << ": device " << p_scb->peer_addr Loading system/bta/ag/bta_ag_sdp.cc +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ static void bta_ag_sdp_cback(uint16_t status, uint8_t idx) { } else { event = BTA_AG_DISC_INT_RES_EVT; } tBTA_AG_DATA disc_result = {.disc_result.status = status}; tBTA_AG_DATA disc_result = {.disc_result = {.status = status}}; do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_sm_execute_by_handle, idx, event, disc_result)); } Loading system/btif/src/btif_hf_client.cc +1 −1 Original line number Diff line number Diff line Loading @@ -747,7 +747,7 @@ static bt_status_t send_at_cmd(const RawAddress* bd_addr, int cmd, int val1, } static const bthf_client_interface_t bthfClientInterface = { sizeof(bthf_client_interface_t), .size = sizeof(bthf_client_interface_t), .init = init, .connect = connect, .disconnect = disconnect, Loading system/gd/hci/device_database.cc +6 −14 Original line number Diff line number Diff line Loading @@ -30,20 +30,16 @@ using namespace bluetooth::hci; std::shared_ptr<ClassicDevice> DeviceDatabase::CreateClassicDevice(Address address) { ClassicDevice device(address); const std::string uuid = device.GetUuid(); if (AddDeviceToMap(std::move(device))) { AddDeviceToMap(std::move(device)); return GetClassicDevice(uuid); } return std::shared_ptr<ClassicDevice>(); } std::shared_ptr<LeDevice> DeviceDatabase::CreateLeDevice(Address address) { LeDevice device(address); const std::string uuid = device.GetUuid(); if (AddDeviceToMap(std::move(device))) { AddDeviceToMap(std::move(device)); return GetLeDevice(uuid); } return std::shared_ptr<LeDevice>(); } std::shared_ptr<DualDevice> DeviceDatabase::CreateDualDevice(Address address) { auto classic = CreateClassicDevice(address); Loading @@ -51,10 +47,9 @@ std::shared_ptr<DualDevice> DeviceDatabase::CreateDualDevice(Address address) { if (classic && le) { DualDevice device(address, classic, le); std::string uuid = device.GetUuid(); if (AddDeviceToMap(std::move(device))) { AddDeviceToMap(std::move(device)); return GetDualDevice(uuid); } } LOG_WARN("Attempting to instert a DUAL device that already exists!"); return std::shared_ptr<DualDevice>(); } Loading Loading @@ -189,7 +184,6 @@ bool DeviceDatabase::AddDeviceToMap(ClassicDevice&& device) { auto it = classic_device_map_.find(device.GetUuid()); // If we have a record with the same key if (it != classic_device_map_.end()) { LOG_ERROR("Attempt to re-insert classic device '%s' object with same UUID", uuid.c_str()); // We don't want to insert and overwrite return false; } Loading Loading @@ -217,7 +211,6 @@ bool DeviceDatabase::AddDeviceToMap(LeDevice&& device) { auto it = le_device_map_.find(device.GetUuid()); // If we have a record with the same key if (it != le_device_map_.end()) { LOG_ERROR("Attempt to re-insert LE device '%s' object with same UUID", uuid.c_str()); // We don't want to insert and overwrite return false; } Loading @@ -244,7 +237,6 @@ bool DeviceDatabase::AddDeviceToMap(DualDevice&& device) { auto it = dual_device_map_.find(device.GetUuid()); // If we have a record with the same key if (it != dual_device_map_.end()) { LOG_ERROR("Attempt to re-insert dual device '%s' object with same UUID", uuid.c_str()); // We don't want to insert and overwrite return false; } Loading system/gd/hci/device_database_test.cc +4 −3 Original line number Diff line number Diff line Loading @@ -61,12 +61,13 @@ TEST_F(DeviceDatabaseTest, create_dual_device) { ASSERT_EQ(address_str, dual_device->GetUuid()); } // Shouldn't fail when creating twice. Should just get back a s_ptr the same device TEST_F(DeviceDatabaseTest, create_classic_device_twice) { auto classic_device = device_database_.CreateClassicDevice(address); ASSERT_TRUE(classic_device); ASSERT_EQ(CLASSIC, classic_device->GetDeviceType()); ASSERT_EQ(address_str, classic_device->GetUuid()); ASSERT_FALSE(device_database_.CreateClassicDevice(address)); ASSERT_TRUE(device_database_.CreateClassicDevice(address)); } TEST_F(DeviceDatabaseTest, create_le_device_twice) { Loading @@ -74,7 +75,7 @@ TEST_F(DeviceDatabaseTest, create_le_device_twice) { ASSERT_TRUE(le_device); ASSERT_EQ(LE, le_device->GetDeviceType()); ASSERT_EQ(address_str, le_device->GetUuid()); ASSERT_FALSE(device_database_.CreateLeDevice(address)); ASSERT_TRUE(device_database_.CreateLeDevice(address)); } TEST_F(DeviceDatabaseTest, create_dual_device_twice) { Loading @@ -93,7 +94,7 @@ TEST_F(DeviceDatabaseTest, create_dual_device_twice) { ASSERT_EQ(DUAL, dual_device->GetLeDevice()->GetDeviceType()); ASSERT_EQ(address_str, dual_device->GetLeDevice()->GetUuid()); ASSERT_FALSE(device_database_.CreateDualDevice(address)); ASSERT_TRUE(device_database_.CreateDualDevice(address)); } TEST_F(DeviceDatabaseTest, remove_device) { Loading Loading
system/bta/ag/bta_ag_main.cc +2 −2 Original line number Diff line number Diff line Loading @@ -564,8 +564,8 @@ void bta_ag_resume_open(tBTA_AG_SCB* p_scb) { if (p_scb->state == BTA_AG_INIT_ST) { LOG(INFO) << __func__ << ": Resume connection to " << p_scb->peer_addr << ", handle" << bta_ag_scb_to_idx(p_scb); tBTA_AG_DATA open_data = {.api_open.bd_addr = p_scb->peer_addr, .api_open.sec_mask = p_scb->cli_sec_mask}; tBTA_AG_DATA open_data = {.api_open = {.bd_addr = p_scb->peer_addr, .sec_mask = p_scb->cli_sec_mask}}; bta_ag_sm_execute(p_scb, BTA_AG_API_OPEN_EVT, open_data); } else { VLOG(1) << __func__ << ": device " << p_scb->peer_addr Loading
system/bta/ag/bta_ag_sdp.cc +1 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ static void bta_ag_sdp_cback(uint16_t status, uint8_t idx) { } else { event = BTA_AG_DISC_INT_RES_EVT; } tBTA_AG_DATA disc_result = {.disc_result.status = status}; tBTA_AG_DATA disc_result = {.disc_result = {.status = status}}; do_in_main_thread(FROM_HERE, base::Bind(&bta_ag_sm_execute_by_handle, idx, event, disc_result)); } Loading
system/btif/src/btif_hf_client.cc +1 −1 Original line number Diff line number Diff line Loading @@ -747,7 +747,7 @@ static bt_status_t send_at_cmd(const RawAddress* bd_addr, int cmd, int val1, } static const bthf_client_interface_t bthfClientInterface = { sizeof(bthf_client_interface_t), .size = sizeof(bthf_client_interface_t), .init = init, .connect = connect, .disconnect = disconnect, Loading
system/gd/hci/device_database.cc +6 −14 Original line number Diff line number Diff line Loading @@ -30,20 +30,16 @@ using namespace bluetooth::hci; std::shared_ptr<ClassicDevice> DeviceDatabase::CreateClassicDevice(Address address) { ClassicDevice device(address); const std::string uuid = device.GetUuid(); if (AddDeviceToMap(std::move(device))) { AddDeviceToMap(std::move(device)); return GetClassicDevice(uuid); } return std::shared_ptr<ClassicDevice>(); } std::shared_ptr<LeDevice> DeviceDatabase::CreateLeDevice(Address address) { LeDevice device(address); const std::string uuid = device.GetUuid(); if (AddDeviceToMap(std::move(device))) { AddDeviceToMap(std::move(device)); return GetLeDevice(uuid); } return std::shared_ptr<LeDevice>(); } std::shared_ptr<DualDevice> DeviceDatabase::CreateDualDevice(Address address) { auto classic = CreateClassicDevice(address); Loading @@ -51,10 +47,9 @@ std::shared_ptr<DualDevice> DeviceDatabase::CreateDualDevice(Address address) { if (classic && le) { DualDevice device(address, classic, le); std::string uuid = device.GetUuid(); if (AddDeviceToMap(std::move(device))) { AddDeviceToMap(std::move(device)); return GetDualDevice(uuid); } } LOG_WARN("Attempting to instert a DUAL device that already exists!"); return std::shared_ptr<DualDevice>(); } Loading Loading @@ -189,7 +184,6 @@ bool DeviceDatabase::AddDeviceToMap(ClassicDevice&& device) { auto it = classic_device_map_.find(device.GetUuid()); // If we have a record with the same key if (it != classic_device_map_.end()) { LOG_ERROR("Attempt to re-insert classic device '%s' object with same UUID", uuid.c_str()); // We don't want to insert and overwrite return false; } Loading Loading @@ -217,7 +211,6 @@ bool DeviceDatabase::AddDeviceToMap(LeDevice&& device) { auto it = le_device_map_.find(device.GetUuid()); // If we have a record with the same key if (it != le_device_map_.end()) { LOG_ERROR("Attempt to re-insert LE device '%s' object with same UUID", uuid.c_str()); // We don't want to insert and overwrite return false; } Loading @@ -244,7 +237,6 @@ bool DeviceDatabase::AddDeviceToMap(DualDevice&& device) { auto it = dual_device_map_.find(device.GetUuid()); // If we have a record with the same key if (it != dual_device_map_.end()) { LOG_ERROR("Attempt to re-insert dual device '%s' object with same UUID", uuid.c_str()); // We don't want to insert and overwrite return false; } Loading
system/gd/hci/device_database_test.cc +4 −3 Original line number Diff line number Diff line Loading @@ -61,12 +61,13 @@ TEST_F(DeviceDatabaseTest, create_dual_device) { ASSERT_EQ(address_str, dual_device->GetUuid()); } // Shouldn't fail when creating twice. Should just get back a s_ptr the same device TEST_F(DeviceDatabaseTest, create_classic_device_twice) { auto classic_device = device_database_.CreateClassicDevice(address); ASSERT_TRUE(classic_device); ASSERT_EQ(CLASSIC, classic_device->GetDeviceType()); ASSERT_EQ(address_str, classic_device->GetUuid()); ASSERT_FALSE(device_database_.CreateClassicDevice(address)); ASSERT_TRUE(device_database_.CreateClassicDevice(address)); } TEST_F(DeviceDatabaseTest, create_le_device_twice) { Loading @@ -74,7 +75,7 @@ TEST_F(DeviceDatabaseTest, create_le_device_twice) { ASSERT_TRUE(le_device); ASSERT_EQ(LE, le_device->GetDeviceType()); ASSERT_EQ(address_str, le_device->GetUuid()); ASSERT_FALSE(device_database_.CreateLeDevice(address)); ASSERT_TRUE(device_database_.CreateLeDevice(address)); } TEST_F(DeviceDatabaseTest, create_dual_device_twice) { Loading @@ -93,7 +94,7 @@ TEST_F(DeviceDatabaseTest, create_dual_device_twice) { ASSERT_EQ(DUAL, dual_device->GetLeDevice()->GetDeviceType()); ASSERT_EQ(address_str, dual_device->GetLeDevice()->GetUuid()); ASSERT_FALSE(device_database_.CreateDualDevice(address)); ASSERT_TRUE(device_database_.CreateDualDevice(address)); } TEST_F(DeviceDatabaseTest, remove_device) { Loading