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

Commit 581b7f3e authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Jakub Pawłowski
Browse files

Get rid of encryption_in_busy_state

Bug: 294886212
Test: mma -j32;
Flag: encryption_in_busy_state
Change-Id: I2b9a3695a44c17cbf1acdeb816f82d4c177b7e35
parent c3a8d9f1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -225,7 +225,6 @@ init_flags!(
        sdp_return_classic_services_when_le_discovery_fails = true,
        use_rsi_from_cached_inqiry_results = false,
        att_mtu_default: i32 = 517,
        encryption_in_busy_state = true,
    }
    extra_parsed_flags: {
        "--hci" => parse_hci_adapter(_, _),
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ mod ffi {
        fn sdp_return_classic_services_when_le_discovery_fails_is_enabled() -> bool;
        fn use_rsi_from_cached_inqiry_results_is_enabled() -> bool;
        fn get_att_mtu_default() -> i32;
        fn encryption_in_busy_state_is_enabled() -> bool;
    }
}

+30 −42
Original line number Diff line number Diff line
@@ -1052,8 +1052,6 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr,
      break;
  }

  /* Enqueue security request if security is active */
  if (bluetooth::common::init_flags::encryption_in_busy_state_is_enabled()) {
  bool enqueue = false;
  switch (p_dev_rec->sec_rec.sec_state) {
    case tSECURITY_STATE::AUTHENTICATING:
@@ -1086,19 +1084,9 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr,
  if (enqueue) {
    log::warn("Security Manager: Enqueue request in state:{}",
              security_state_text(p_dev_rec->sec_rec.sec_state));
      btm_sec_queue_encrypt_request(bd_addr, transport, p_callback, p_ref_data,
                                    sec_act);
    btm_sec_queue_encrypt_request(bd_addr, transport, p_callback, p_ref_data, sec_act);
    return BTM_CMD_STARTED;
  }
  } else {
    if (p_dev_rec->sec_rec.p_callback || (p_dev_rec->sec_rec.sec_state != tSECURITY_STATE::IDLE)) {
      log::warn("Security Manager: BTM_SetEncryption busy, enqueue request");
      btm_sec_queue_encrypt_request(bd_addr, transport, p_callback, p_ref_data,
                                    sec_act);
      log::info("Queued start encryption");
      return BTM_CMD_STARTED;
    }
  }

  p_dev_rec->sec_rec.p_callback = p_callback;
  p_dev_rec->sec_rec.p_ref_data = p_ref_data;