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

Commit 4795c3ce authored by Jay Patel's avatar Jay Patel Committed by Gerrit Code Review
Browse files

Merge "Handle AVRCP fragment due to unique event 0xFFF"

parents 17df4c74 7fa3b71a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -534,6 +534,11 @@ void ConnectionHandler::SendMessage(
  // doesn't need to be processed. In the future, this is the only place sending
  // the packet so none of these layer specific fields will be used.
  pkt->event = 0xFFFF;
  /* Handle for AVRCP fragment */
  uint16_t op_code = (uint16_t)(::bluetooth::Packet::Specialize<Packet>(packet)->GetOpcode());
  if (!browse && (op_code == (uint16_t)(Opcode::VENDOR))) {
    pkt->event = op_code;
  }

  // TODO (apanicke): This layer specific stuff can go away once we move over
  // to the new service.
+24 −18
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include "btu.h"
#include "osi/include/fixed_queue.h"
#include "osi/include/osi.h"
#include "osi/include/properties.h"

/*****************************************************************************
 *  Global data
@@ -1113,10 +1114,14 @@ uint16_t AVRC_MsgReq(uint8_t handle, uint8_t label, uint8_t ctype,

  AVRC_TRACE_DEBUG("%s handle = %u label = %u ctype = %u len = %d", __func__,
                   handle, label, ctype, p_pkt->len);

  /* Handle for AVRCP fragment */
  bool is_new_avrcp = osi_property_get_bool("persist.bluetooth.enablenewavrcp", true);
  if (ctype >= AVRC_RSP_NOT_IMPL) cr = AVCT_RSP;

  if (p_pkt->event == AVRC_OP_VENDOR) {
    if (is_new_avrcp) {
      p_start = (uint8_t*)(p_pkt + 1) + p_pkt->offset + AVRC_VENDOR_HDR_SIZE;
    } else {
      /* add AVRCP Vendor Dependent headers */
      p_start = ((uint8_t*)(p_pkt + 1) + p_pkt->offset);
      p_pkt->offset -= AVRC_VENDOR_HDR_SIZE;
@@ -1136,6 +1141,7 @@ uint16_t AVRC_MsgReq(uint8_t handle, uint8_t label, uint8_t ctype,
          msg_mask |= AVRC_MSG_MASK_IS_CONTINUATION_RSP;
        }
      }
    }
  } else if (p_pkt->event == AVRC_OP_PASS_THRU) {
    /* add AVRCP Pass Through headers */
    p_start = ((uint8_t*)(p_pkt + 1) + p_pkt->offset);