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

Commit 662b2259 authored by Zach Johnson's avatar Zach Johnson
Browse files

Fold security mask into AVCT_Register

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9c011afaa8255a01d555d78ed0c0939aab1944c8
parent 1fa539ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ void bta_ar_avdt_conn(tBTA_SYS_ID sys_id, const RawAddress& bd_addr,
 ******************************************************************************/
void bta_ar_reg_avct(uint16_t mtu, uint16_t mtu_br) {
  if (bta_ar_cb.avct_registered == 0) {
    AVCT_Register(mtu, mtu_br, BTA_SEC_AUTHENTICATE);
    AVCT_Register(mtu, mtu_br);
  }
  bta_ar_cb.avct_registered |= BTA_AR_AV_MASK;
}
+6 −4
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "bt_target.h"
#include "bt_types.h"
#include "bt_utils.h"
#include "bta/include/bta_api.h"
#include "btm_api.h"
#include "l2c_api.h"
#include "l2cdefs.h"
@@ -52,8 +53,7 @@ tAVCT_CB avct_cb;
 * Returns          void
 *
 ******************************************************************************/
void AVCT_Register(uint16_t mtu, UNUSED_ATTR uint16_t mtu_br,
                   uint8_t sec_mask) {
void AVCT_Register(uint16_t mtu, UNUSED_ATTR uint16_t mtu_br) {
  AVCT_TRACE_API("AVCT_Register");

  /* initialize AVCTP data structures */
@@ -67,7 +67,8 @@ void AVCT_Register(uint16_t mtu, UNUSED_ATTR uint16_t mtu_br,
  L2CA_Register(AVCT_PSM, (tL2CAP_APPL_INFO*)&avct_l2c_appl,
                true /* enable_snoop */, nullptr, avct_cb.mtu);

  BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_AVCTP, sec_mask, AVCT_PSM);
  BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_AVCTP, BTA_SEC_AUTHENTICATE,
                             AVCT_PSM);

  /* Include the browsing channel which uses eFCR */
  tL2CAP_ERTM_INFO ertm_info;
@@ -86,7 +87,8 @@ void AVCT_Register(uint16_t mtu, UNUSED_ATTR uint16_t mtu_br,

  /* AVCTP browsing channel uses the same security service as AVCTP control
   * channel */
  BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_AVCTP, sec_mask, AVCT_BR_PSM);
  BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_AVCTP, BTA_SEC_AUTHENTICATE,
                             AVCT_BR_PSM);

#if defined(AVCT_INITIAL_TRACE_LEVEL)
  avct_cb.trace_level = AVCT_INITIAL_TRACE_LEVEL;
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ typedef struct {
 * Returns          void
 *
 ******************************************************************************/
extern void AVCT_Register(uint16_t mtu, uint16_t mtu_br, uint8_t sec_mask);
extern void AVCT_Register(uint16_t mtu, uint16_t mtu_br);

/*******************************************************************************
 *