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

Commit 3b735dab authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Remove useless BTM role definition am: f8259bc5

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1393598

Change-Id: Ib508d8c4339593d9ef315a783655a78a0814da76
parents 06854daa f8259bc5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1870,7 +1870,7 @@ void bta_av_do_start(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
   * i.e. allow role switch, if we are slave.
   * It would not hurt us, if the peer device wants us to be master */
  if ((BTM_GetRole(p_scb->PeerAddress(), &cur_role) == BTM_SUCCESS) &&
      (cur_role == BTM_ROLE_MASTER)) {
      (cur_role == HCI_ROLE_MASTER)) {
    clear_policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
  }

@@ -2380,7 +2380,7 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
       * Because it would not hurt source, if the peer device wants source to be
       * master */
      if ((BTM_GetRole(p_scb->PeerAddress(), &cur_role) == BTM_SUCCESS) &&
          (cur_role == BTM_ROLE_MASTER)) {
          (cur_role == HCI_ROLE_MASTER)) {
        clear_policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
      }

+7 −7
Original line number Diff line number Diff line
@@ -963,7 +963,7 @@ static void bta_av_sys_rs_cback(UNUSED_ATTR tBTA_SYS_CONN_STATUS status,
          "%s: peer %s found: new_role:%d, hci_status:0x%x bta_handle:0x%x",
          __func__, peer_addr.ToString().c_str(), id, app_id, p_scb->hndl);
      /*
      if ((id != BTM_ROLE_MASTER) && (app_id != HCI_SUCCESS))
      if ((id != HCI_ROLE_MASTER) && (app_id != HCI_SUCCESS))
      {
          bta_sys_set_policy(BTA_ID_AV, set_policy, p_scb->PeerAddress());
      }
@@ -981,7 +981,7 @@ static void bta_av_sys_rs_cback(UNUSED_ATTR tBTA_SYS_CONN_STATUS status,
  /* restore role switch policy, if role switch failed */
  if ((HCI_SUCCESS != app_id) &&
      (BTM_GetRole(peer_addr, &cur_role) == BTM_SUCCESS) &&
      (cur_role == BTM_ROLE_SLAVE)) {
      (cur_role == HCI_ROLE_SLAVE)) {
    bta_sys_set_policy(BTA_ID_AV, set_policy, peer_addr);
  }

@@ -1106,12 +1106,12 @@ bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
      BTM_GetRole(p_scbi->PeerAddress(), &role);
      /* this channel is open - clear the role switch link policy for this link
       */
      if (BTM_ROLE_MASTER != role) {
      if (HCI_ROLE_MASTER != role) {
        if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
          bta_sys_clear_policy(BTA_ID_AV, HCI_ENABLE_MASTER_SLAVE_SWITCH,
                               p_scbi->PeerAddress());
        if (BTM_CMD_STARTED !=
            BTM_SwitchRole(p_scbi->PeerAddress(), BTM_ROLE_MASTER, NULL)) {
            BTM_SwitchRole(p_scbi->PeerAddress(), HCI_ROLE_MASTER, NULL)) {
          /* can not switch role on SCBI
           * start the timer on SCB - because this function is ONLY called when
           * SCB gets API_OPEN */
@@ -1149,7 +1149,7 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
        "features:0x%x",
        __func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl, role,
        bta_av_cb.conn_audio, bits, bta_av_cb.features);
    if (BTM_ROLE_MASTER != role &&
    if (HCI_ROLE_MASTER != role &&
        (A2DP_BitsSet(bta_av_cb.conn_audio) > bits ||
         (bta_av_cb.features & BTA_AV_FEAT_MASTER))) {
      if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
@@ -1157,10 +1157,10 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
                             p_scb->PeerAddress());

      tBTM_STATUS status =
          BTM_SwitchRole(p_scb->PeerAddress(), BTM_ROLE_MASTER, NULL);
          BTM_SwitchRole(p_scb->PeerAddress(), HCI_ROLE_MASTER, NULL);
      if (status != BTM_CMD_STARTED) {
        /* can not switch role on SCB - start the timer on SCB */
        LOG_ERROR("%s: peer %s BTM_SwitchRole(BTM_ROLE_MASTER) error: %d",
        LOG_ERROR("%s: peer %s BTM_SwitchRole(HCI_ROLE_MASTER) error: %d",
                  __func__, p_scb->PeerAddress().ToString().c_str(), status);
      }
      if (status != BTM_MODE_UNSUPPORTED && status != BTM_DEV_BLACKLISTED) {
+1 −1
Original line number Diff line number Diff line
@@ -2682,7 +2682,7 @@ static void handle_role_change(const RawAddress& bd_addr, uint8_t new_role,
      /* more than one connections and the AV connection is role switched
       * to slave
       * switch it back to master and remove the switch policy */
      BTM_SwitchRole(bd_addr, BTM_ROLE_MASTER, NULL);
      BTM_SwitchRole(bd_addr, HCI_ROLE_MASTER, NULL);
      need_policy_change = true;
    } else if (p_bta_dm_cfg->avoid_scatter && (new_role == HCI_ROLE_MASTER)) {
      /* if the link updated to be master include AV activities, remove
+3 −3
Original line number Diff line number Diff line
@@ -506,7 +506,7 @@ tBTM_STATUS BTM_GetRole(const RawAddress& remote_bd_addr, uint8_t* p_role) {
  BTM_TRACE_DEBUG("BTM_GetRole");
  p = btm_bda_to_acl(remote_bd_addr, BT_TRANSPORT_BR_EDR);
  if (p == NULL) {
    *p_role = BTM_ROLE_UNDEFINED;
    *p_role = HCI_ROLE_UNKNOWN;
    return (BTM_UNKNOWN_ADDR);
  }

@@ -1230,7 +1230,7 @@ tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda,
    p->link_super_tout = timeout;

    /* Only send if current role is Master; 2.0 spec requires this */
    if (p->link_role == BTM_ROLE_MASTER) {
    if (p->link_role == HCI_ROLE_MASTER) {
      btsnd_hcic_write_link_super_tout(LOCAL_BR_EDR_CONTROLLER_ID,
                                       p->hci_handle, timeout);
      return (BTM_CMD_STARTED);
@@ -1444,7 +1444,7 @@ void btm_acl_role_changed(uint8_t hci_status, const RawAddress* bd_addr,

    /* Reload LSTO: link supervision timeout is reset in the LM after a role
     * switch */
    if (new_role == BTM_ROLE_MASTER) {
    if (new_role == HCI_ROLE_MASTER) {
      BTM_SetLinkSuperTout(p->remote_addr, p->link_super_tout);
    }
  } else {
+2 −2
Original line number Diff line number Diff line
@@ -1538,7 +1538,7 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr,

  switch (sec_act) {
    case BTM_BLE_SEC_ENCRYPT:
      if (link_role == BTM_ROLE_MASTER) {
      if (link_role == HCI_ROLE_MASTER) {
        /* start link layer encryption using the security info stored */
        cmd = btm_ble_start_encrypt(bd_addr, false, NULL);
        break;
@@ -1558,7 +1558,7 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr,
        cmd = BTM_SUCCESS;
        break;
      }
      if (link_role == BTM_ROLE_MASTER) {
      if (link_role == HCI_ROLE_MASTER) {
        if (sec_req_act == BTM_BLE_SEC_REQ_ACT_ENCRYPT) {
          cmd = btm_ble_start_encrypt(bd_addr, false, NULL);
          break;
Loading