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

Commit 87468350 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

We always want to switch role to central

When we continue role switch from mode change or encryption change, we
always want to switch to central, as we only made requests to change to
central.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Iff4ef160956fe2ba5901d24bf1f804570ef3d57e
parent b64b0a7f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ void btm_acl_encrypt_change(uint16_t handle, uint8_t status,
      p->set_switch_role_switching();
    }

    btsnd_hcic_switch_role(p->remote_addr, (uint8_t)!p->link_role);
    btsnd_hcic_switch_role(p->remote_addr, HCI_ROLE_CENTRAL);
    p->rs_disc_pending = BTM_SEC_RS_PENDING;
  }
  /* Finished enabling Encryption after role switch */
@@ -2101,7 +2101,7 @@ void btm_cont_rswitch_from_handle(uint16_t hci_handle) {
      if (p->is_switch_role_mode_change()) {
        p->set_switch_role_in_progress();
        p->rs_disc_pending = BTM_SEC_RS_PENDING;
        btsnd_hcic_switch_role(p->remote_addr, (uint8_t)!p->link_role);
        btsnd_hcic_switch_role(p->remote_addr, HCI_ROLE_CENTRAL);
      }
    }
  }