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

Commit 8723d3dc authored by Chris Manton's avatar Chris Manton
Browse files

Remove unused code

Towards readable code

Bug: 163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Test: classic paired Bose SoundLink
Change-Id: I646bd2f5ee59cd0ba3cf321a04c143605251b438
parent affdbada
Loading
Loading
Loading
Loading
+0 −41
Original line number Diff line number Diff line
@@ -191,47 +191,6 @@ const uint16_t bta_service_id_to_uuid_lkup_tbl[BTA_MAX_SERVICE_ID] = {
    UUID_PROTOCOL_ATT                     /* BTA_GATT_SERVICE_ID */
};

/*
 * NOTE : The number of element in bta_service_id_to_btm_srv_id_lkup_tbl should
 * be matching with the value BTA_MAX_SERVICE_ID in bta_api.h
 *
 * i.e., If you add new Service ID for BTA, the correct security ID of the new
 * service from Security service definitions (btm_api.h) should be added to
 * this lookup table.
 */
const uint32_t bta_service_id_to_btm_srv_id_lkup_tbl[BTA_MAX_SERVICE_ID] = {
    0,                             /* Reserved */
    BTM_SEC_SERVICE_SERIAL_PORT,   /* BTA_SPP_SERVICE_ID */
    BTM_SEC_SERVICE_DUN,           /* BTA_DUN_SERVICE_ID */
    BTM_SEC_SERVICE_AVDTP,         /* BTA_AUDIO_SOURCE_SERVICE_ID */
    BTM_SEC_SERVICE_LAN_ACCESS,    /* BTA_LAP_SERVICE_ID */
    BTM_SEC_SERVICE_HEADSET_AG,    /* BTA_HSP_SERVICE_ID */
    BTM_SEC_SERVICE_AG_HANDSFREE,  /* BTA_HFP_SERVICE_ID */
    BTM_SEC_SERVICE_OBEX,          /* BTA_OPP_SERVICE_ID */
    BTM_SEC_SERVICE_OBEX_FTP,      /* BTA_FTP_SERVICE_ID */
    BTM_SEC_SERVICE_CORDLESS,      /* BTA_CTP_SERVICE_ID */
    BTM_SEC_SERVICE_INTERCOM,      /* BTA_ICP_SERVICE_ID */
    BTM_SEC_SERVICE_IRMC_SYNC,     /* BTA_SYNC_SERVICE_ID */
    BTM_SEC_SERVICE_BPP_JOB,       /* BTA_BPP_SERVICE_ID */
    BTM_SEC_SERVICE_BIP,           /* BTA_BIP_SERVICE_ID */
    BTM_SEC_SERVICE_BNEP_PANU,     /* BTA_PANU_SERVICE_ID */
    BTM_SEC_SERVICE_BNEP_NAP,      /* BTA_NAP_SERVICE_ID */
    BTM_SEC_SERVICE_BNEP_GN,       /* BTA_GN_SERVICE_ID */
    BTM_SEC_SERVICE_SAP,           /* BTA_SAP_SERVICE_ID */
    BTM_SEC_SERVICE_AVDTP,         /* BTA_A2DP_SERVICE_ID */
    BTM_SEC_SERVICE_AVCTP,         /* BTA_AVRCP_SERVICE_ID */
    BTM_SEC_SERVICE_HIDH_SEC_CTRL, /* BTA_HID_SERVICE_ID */
    BTM_SEC_SERVICE_AVDTP,         /* BTA_VDP_SERVICE_ID */
    BTM_SEC_SERVICE_PBAP,          /* BTA_PBAP_SERVICE_ID */
    BTM_SEC_SERVICE_HEADSET,       /* BTA_HSP_HS_SERVICE_ID */
    BTM_SEC_SERVICE_HF_HANDSFREE,  /* BTA_HFP_HS_SERVICE_ID */
    BTM_SEC_SERVICE_MAP,           /* BTA_MAP_SERVICE_ID */
    BTM_SEC_SERVICE_MAP,           /* BTA_MN_SERVICE_ID */
    BTM_SEC_SERVICE_HDP_SNK,       /* BTA_HDP_SERVICE_ID */
    BTM_SEC_SERVICE_PBAP,          /* BTA_PCE_SERVICE_ID */
    BTM_SEC_SERVICE_ATT            /* BTA_GATT_SERVICE_ID */
};

/* bta security callback */
const tBTM_APPL_INFO bta_security = {&bta_dm_pin_cback,
                                     &bta_dm_new_link_key_cback,
+0 −5
Original line number Diff line number Diff line
@@ -49,11 +49,6 @@ typedef uint8_t tBTA_STATUS;

/*
 * Service ID
 *
 * NOTES: When you add a new Service ID for BTA AND require to change the value
 * of BTA_MAX_SERVICE_ID, make sure that the correct security ID of the new
 * service from Security service definitions (btm_api.h) should be added to
 * bta_service_id_to_btm_srv_id_lkup_tbl table in bta_dm_act.cc
 */

#define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */
+0 −25
Original line number Diff line number Diff line
@@ -158,31 +158,6 @@ static void btm_esco_conn_rsp(uint16_t sco_inx, uint8_t hci_status,
      *p_setup = btm_cb.sco_cb.def_esco_parms;
    }

    uint16_t temp_packet_types =
        (p_setup->packet_types & BTM_SCO_SUPPORTED_PKTS_MASK &
         btm_cb.btm_sco_pkt_types_supported);

    /* Make sure at least one eSCO packet type is sent, else might confuse peer
     */
    /* Taking this out to confirm with BQB tests
    ** Real application would like to include this though, as many devices
    ** do not retry with SCO only if an eSCO connection fails.
    if (!(temp_packet_types & BTM_ESCO_LINK_ONLY_MASK))
    {
        temp_packet_types |= BTM_SCO_PKT_TYPES_MASK_EV3;
    }
    */
    /* If SCO request, remove eSCO packet types (conformance) */
    if (p_sco->esco.data.link_type == BTM_LINK_TYPE_SCO) {
      temp_packet_types &= BTM_SCO_LINK_ONLY_MASK;
      temp_packet_types |= BTM_SCO_EXCEPTION_PKTS_MASK;
    } else {
      /* OR in any exception packet types */
      temp_packet_types |=
          ((p_setup->packet_types & BTM_SCO_EXCEPTION_PKTS_MASK) |
           (btm_cb.btm_sco_pkt_types_supported & BTM_SCO_EXCEPTION_PKTS_MASK));
    }

    /* Use Enhanced Synchronous commands if supported */
    if (controller_get_interface()
            ->supports_enhanced_setup_synchronous_connection()) {
+0 −8
Original line number Diff line number Diff line
@@ -811,9 +811,6 @@ tHID_STATUS hidh_conn_snd_data(uint8_t dhandle, uint8_t trans_type,
 *
 ******************************************************************************/
tHID_STATUS hidh_conn_initiate(uint8_t dhandle) {
  uint8_t service_id = BTM_SEC_SERVICE_HIDH_NOSEC_CTRL;
  uint32_t mx_chan_id = HID_NOSEC_CHN;

  tHID_HOST_DEV_CTB* p_dev = &hh_cb.devices[dhandle];

  if (p_dev->conn.conn_state != HID_CONN_STATE_UNUSED)
@@ -828,11 +825,6 @@ tHID_STATUS hidh_conn_initiate(uint8_t dhandle) {
  /* We are the originator of this connection */
  p_dev->conn.conn_flags = HID_CONN_FLAGS_IS_ORIG;

  if (p_dev->attr_mask & HID_SEC_REQUIRED) {
    service_id = BTM_SEC_SERVICE_HIDH_SEC_CTRL;
    mx_chan_id = HID_SEC_CHN;
  }

  /* Check if L2CAP started the connection process */
  p_dev->conn.ctrl_cid = L2CA_ConnectReq2(
      HID_PSM_CONTROL, p_dev->addr, BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT);
+0 −34
Original line number Diff line number Diff line
@@ -531,44 +531,10 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
#define BTM_SEC_PROTO_HID 6 /* HID      */
#define BTM_SEC_PROTO_AVDT 7

/* Security service definitions (BTM_SetSecurityLevel)
 * Used for Authorization APIs
*/
#define BTM_SEC_SERVICE_SDP_SERVER 0
#define BTM_SEC_SERVICE_SERIAL_PORT 1
#define BTM_SEC_SERVICE_LAN_ACCESS 2
#define BTM_SEC_SERVICE_DUN 3
#define BTM_SEC_SERVICE_IRMC_SYNC 4
#define BTM_SEC_SERVICE_OBEX 6
#define BTM_SEC_SERVICE_OBEX_FTP 7
#define BTM_SEC_SERVICE_HEADSET 8
#define BTM_SEC_SERVICE_CORDLESS 9
#define BTM_SEC_SERVICE_INTERCOM 10
#define BTM_SEC_SERVICE_HEADSET_AG 12
#define BTM_SEC_SERVICE_BPP_JOB 22
#define BTM_SEC_SERVICE_BNEP_PANU 25
#define BTM_SEC_SERVICE_BNEP_GN 26
#define BTM_SEC_SERVICE_BNEP_NAP 27
#define BTM_SEC_SERVICE_HF_HANDSFREE 28
#define BTM_SEC_SERVICE_AG_HANDSFREE 29

#define BTM_SEC_SERVICE_HIDH_SEC_CTRL 32
#define BTM_SEC_SERVICE_HIDH_NOSEC_CTRL 33
#define BTM_SEC_SERVICE_HIDH_INTR 34
#define BTM_SEC_SERVICE_BIP 35
#define BTM_SEC_SERVICE_AVDTP 37
#define BTM_SEC_SERVICE_AVDTP_NOSEC 38
#define BTM_SEC_SERVICE_AVCTP 39
#define BTM_SEC_SERVICE_SAP 40
#define BTM_SEC_SERVICE_PBAP 41
#define BTM_SEC_SERVICE_RFC_MUX 42
#define BTM_SEC_SERVICE_AVCTP_BROWSE 43
#define BTM_SEC_SERVICE_MAP 44
#define BTM_SEC_SERVICE_HDP_SNK 48
#define BTM_SEC_SERVICE_ATT 50
#define BTM_SEC_SERVICE_HIDD_SEC_CTRL 51
#define BTM_SEC_SERVICE_HIDD_NOSEC_CTRL 52
#define BTM_SEC_SERVICE_HIDD_INTR 53
#define BTM_SEC_SERVICE_HEARING_AID_LEFT 54
#define BTM_SEC_SERVICE_HEARING_AID_RIGHT 55