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

Commit 69fd7652 authored by Jack He's avatar Jack He
Browse files

Remove BTM_SCO_INCLUDED flag

* Instead of removing SCO related code during compilation, platforms
  should chose not to call SCO related methods when SCO is not supported
* For example, platforms can choose to not initialize HFP to avoid using
  SCO commands
* This CL removes BTM_SCO_INCLUDED compile time flag to simplify code
  flow and improve readability

Bug: 122279647
Test: mm -j40; run Bluetooth stack and make phone call
Change-Id: I67d290839091f66c289a428496304c8b3e1dbe21
parent e80bfd5b
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -275,11 +275,6 @@
#define BTM_NO_SSP_ON_INQUIRY FALSE
#endif

/* Includes SCO if TRUE */
#ifndef BTM_SCO_INCLUDED
#define BTM_SCO_INCLUDED TRUE /* TRUE includes SCO code */
#endif

#ifndef DISABLE_WBS
#define DISABLE_WBS FALSE
#endif
+0 −4
Original line number Diff line number Diff line
@@ -537,9 +537,7 @@ tBTM_STATUS BTM_SwitchRole(const RawAddress& remote_bd_addr, uint8_t new_role,
                           tBTM_CMPL_CB* p_cb) {
  tACL_CONN* p;
  tBTM_SEC_DEV_REC* p_dev_rec = NULL;
#if (BTM_SCO_INCLUDED == TRUE)
  bool is_sco_active;
#endif
  tBTM_STATUS status;
  tBTM_PM_MODE pwr_mode;
  tBTM_PM_PWR_MD settings;
@@ -567,12 +565,10 @@ tBTM_STATUS BTM_SwitchRole(const RawAddress& remote_bd_addr, uint8_t new_role,
  if (interop_match_addr(INTEROP_DISABLE_ROLE_SWITCH, &remote_bd_addr))
    return BTM_DEV_BLACKLISTED;

#if (BTM_SCO_INCLUDED == TRUE)
  /* Check if there is any SCO Active on this BD Address */
  is_sco_active = btm_is_sco_active_by_bdaddr(remote_bd_addr);

  if (is_sco_active) return (BTM_NO_RESOURCES);
#endif

  /* Ignore role switch request if the previous request was not completed */
  if (p->switch_role_state != BTM_ACL_SWKEY_STATE_IDLE) {
+0 −2
Original line number Diff line number Diff line
@@ -285,10 +285,8 @@ bool btm_dev_support_switch(const RawAddress& bd_addr) {
  uint8_t xx;
  bool feature_empty = true;

#if (BTM_SCO_INCLUDED == TRUE)
  /* Role switch is not allowed if a SCO is up */
  if (btm_is_sco_active_by_bdaddr(bd_addr)) return (false);
#endif
  p_dev_rec = btm_find_dev(bd_addr);
  if (p_dev_rec &&
      controller_get_interface()->supports_master_slave_role_switch()) {
+0 −2
Original line number Diff line number Diff line
@@ -320,9 +320,7 @@ static void btm_decode_ext_features_page(uint8_t page_number,

      /* Create (e)SCO supported packet types mask */
      btm_cb.btm_sco_pkt_types_supported = 0;
#if (BTM_SCO_INCLUDED == TRUE)
      btm_cb.sco_cb.esco_supported = false;
#endif
      if (HCI_SCO_LINK_SUPPORTED(p_features)) {
        btm_cb.btm_sco_pkt_types_supported = ESCO_PKT_TYPES_MASK_HV1;

+0 −5
Original line number Diff line number Diff line
@@ -142,12 +142,7 @@ extern void btm_pm_proc_mode_change(uint8_t hci_status, uint16_t hci_handle,
extern void btm_pm_proc_ssr_evt(uint8_t* p, uint16_t evt_len);
extern tBTM_STATUS btm_read_power_mode_state(const RawAddress& remote_bda,
                                             tBTM_PM_STATE* pmState);
#if (BTM_SCO_INCLUDED == TRUE)
extern void btm_sco_chk_pend_unpark(uint8_t hci_status, uint16_t hci_handle);
#else
#define btm_sco_chk_pend_unpark(hci_status, hci_handle)
#endif /* BTM_SCO_INCLUDED */

extern void btm_qos_setup_timeout(void* data);
extern void btm_qos_setup_complete(uint8_t status, uint16_t handle,
                                   FLOW_SPEC* p_flow);
Loading