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

Commit 75502e4a authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

ACL: Fix on_connection_packet_type_changed am: 73ce45bd am: cc5add54

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1513258

Change-Id: Ifcf920910893a93eec385c1a3d401ce920ad3ebe
parents b5fc7e6a cc5add54
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -243,10 +243,7 @@ struct classic_impl : public security::ISecurityManagerListener {
      LOG_ERROR("Received on_connection_packet_type_changed with error code %s", error_code.c_str());
      return;
    }
    uint16_t handle = packet_type_changed.GetConnectionHandle();
    auto& acl_connection = acl_connections_.find(handle)->second;
    uint16_t packet_type = packet_type_changed.GetPacketType();
    acl_connection.connection_management_callbacks_->OnConnectionPacketTypeChanged(packet_type);
    // We don't handle this event; we didn't do this in legacy stack either.
  }

  void on_central_link_key_complete(EventPacketView packet) {
+0 −12
Original line number Diff line number Diff line
@@ -910,18 +910,6 @@ TEST_F(AclManagerWithConnectionTest, send_write_default_link_policy_settings) {
  ASSERT_EQ(link_policy_settings, acl_manager_->ReadDefaultLinkPolicySettings());
}

TEST_F(AclManagerWithConnectionTest, send_change_connection_packet_type) {
  test_hci_layer_->SetCommandFuture();
  connection_->ChangeConnectionPacketType(0xEE1C);
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::CHANGE_CONNECTION_PACKET_TYPE);
  auto command_view = ChangeConnectionPacketTypeView::Create(packet);
  ASSERT_TRUE(command_view.IsValid());
  ASSERT_EQ(command_view.GetPacketType(), 0xEE1C);

  EXPECT_CALL(mock_connection_management_callbacks_, OnConnectionPacketTypeChanged(0xEE1C));
  test_hci_layer_->IncomingEvent(ConnectionPacketTypeChangedBuilder::Create(ErrorCode::SUCCESS, handle_, 0xEE1C));
}

TEST_F(AclManagerWithConnectionTest, send_authentication_requested) {
  test_hci_layer_->SetCommandFuture();
  connection_->AuthenticationRequested();