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

Commit 30948e37 authored by JiLin Wan's avatar JiLin Wan Committed by huirong liao
Browse files

Fix new avrcp error response

[Description]
new avrcp error response the passthrough response pkt.

[Root Cause]
when src sink role both enabled, the new avrcp and legacy
avrcp message callback would be both enabled at the certain
timing which cannot close one of them, so the new avrcp
may receive the error response pkt.

[Solution]
Add check to avoid error response.

Bug: 256946047
Test: AVRCP connect and play successfully

Change-Id: Idc03b2376667e954152d7c6870c24354f03a37a8
parent 1ca1b1b2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -680,6 +680,11 @@ void Device::MessageReceived(uint8_t label, std::shared_ptr<Packet> pkt) {
    case Opcode::SUBUNIT_INFO: {
    } break;
    case Opcode::PASS_THROUGH: {
      /** Newavrcp not passthrough response pkt. @{ */
      if (pkt->GetCType() == CType::ACCEPTED || pkt->GetCType() == CType::REJECTED
          || pkt->GetCType() == CType::NOT_IMPLEMENTED)
        break;
      /** @} */
      auto pass_through_packet = Packet::Specialize<PassThroughPacket>(pkt);

      if (!pass_through_packet->IsValid()) {