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

Commit 9e42e058 authored by Jack He's avatar Jack He
Browse files

Remove BTM_SCO_WAKE_PARKED_LINK flag

* Under majority of configurations, SCO connection can only be created
  if in non-parked mode since SCO is a circuit switch link

Bug: 122375953
Test: make
Change-Id: I58569025b435953b964e5aded64b3ace27d4e73c
parent f69439ec
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -404,14 +404,8 @@
#define BTM_PM_DEBUG FALSE
#endif

/* This is set to TRUE if link is to be unparked due to BTM_CreateSCO API. */
#ifndef BTM_SCO_WAKE_PARKED_LINK
#define BTM_SCO_WAKE_PARKED_LINK TRUE
#endif

/* If the user does not respond to security process requests within this many
 * seconds,
 * a negative response would be sent automatically.
 * seconds, a negative response would be sent automatically.
 * 30 is LMP response timeout value */
#ifndef BTM_SEC_TIMEOUT_VALUE
#define BTM_SEC_TIMEOUT_VALUE 35
+1 −10
Original line number Diff line number Diff line
@@ -483,8 +483,7 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
    if (p->state == SCO_ST_UNUSED) {
      if (remote_bda) {
        if (is_orig) {
/* can not create SCO link if in park mode */
#if (BTM_SCO_WAKE_PARKED_LINK == TRUE)
          // can not create SCO link if in park mode
          tBTM_PM_STATE state;
          if ((btm_read_power_mode_state(*remote_bda, &state) == BTM_SUCCESS)) {
            if (state == BTM_PM_ST_SNIFF || state == BTM_PM_ST_PARK ||
@@ -501,12 +500,6 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
            LOG(ERROR) << __func__ << ": failed to read power mode for "
                       << *remote_bda;
          }
#else   // BTM_SCO_WAKE_PARKED_LINK
          uint8_t mode;
          if ((BTM_ReadPowerMode(*remote_bda, &mode) == BTM_SUCCESS) &&
              (mode == BTM_PM_MD_PARK))
            return (BTM_WRONG_MODE);
#endif  // BTM_SCO_WAKE_PARKED_LINK
        }
        p->esco.data.bd_addr = *remote_bda;
        p->rem_bd_known = true;
@@ -578,7 +571,6 @@ tBTM_STATUS BTM_CreateSco(const RawAddress* remote_bda, bool is_orig,
  return BTM_NO_RESOURCES;
}

#if (BTM_SCO_WAKE_PARKED_LINK == TRUE)
/*******************************************************************************
 *
 * Function         btm_sco_chk_pend_unpark
@@ -612,7 +604,6 @@ void btm_sco_chk_pend_unpark(uint8_t hci_status, uint16_t hci_handle) {
  }
#endif  // BTM_MAX_SCO_LINKS
}
#endif  // BTM_SCO_WAKE_PARKED_LINK

/*******************************************************************************
 *
+0 −4
Original line number Diff line number Diff line
@@ -1028,7 +1028,6 @@ static void btu_hcif_hdl_command_status(uint16_t opcode, uint8_t status,
  switch (opcode) {
    case HCI_EXIT_SNIFF_MODE:
    case HCI_EXIT_PARK_MODE:
#if (BTM_SCO_WAKE_PARKED_LINK == TRUE)
      if (status != HCI_SUCCESS) {
        /* Allow SCO initiation to continue if waiting for change mode event */
        if (p_cmd != NULL) {
@@ -1037,7 +1036,6 @@ static void btu_hcif_hdl_command_status(uint16_t opcode, uint8_t status,
          btm_sco_chk_pend_unpark(status, handle);
        }
      }
#endif
      FALLTHROUGH_INTENDED; /* FALLTHROUGH */

    case HCI_HOLD_MODE:
@@ -1279,9 +1277,7 @@ static void btu_hcif_mode_change_evt(uint8_t* p) {
  STREAM_TO_UINT16(handle, p);
  STREAM_TO_UINT8(current_mode, p);
  STREAM_TO_UINT16(interval, p);
#if (BTM_SCO_WAKE_PARKED_LINK == TRUE)
  btm_sco_chk_pend_unpark(status, handle);
#endif
  btm_pm_proc_mode_change(status, handle, current_mode, interval);

#if (HID_DEV_INCLUDED == TRUE && HID_DEV_PM_INCLUDED == TRUE)