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

Commit 95f2eebe authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

Queue secure L2CAP connection requests while encryption is pending

Tag: #feature
Bug: 262171591
Test: Manual
Merged-In: Ia9bd56c7c5cb6db5b4a51989f42e064834958409
Change-Id: Ia9bd56c7c5cb6db5b4a51989f42e064834958409
parent 23bef9ea
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ table InitFlagsData {
    // is_debug_logging_enabled_for_tag -- skipped in dumpsys
    logging_debug_enabled_for_all_is_enabled:bool (privacy:"Any");
    pass_phy_update_callback_is_enabled:bool (privacy:"Any");
    queue_l2cap_coc_while_encrypting_is_enabled:bool (privacy:"Any");
    sdp_serialization_is_enabled:bool (privacy:"Any");
    sdp_skip_rnr_if_known_is_enabled:bool (privacy:"Any");
}
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFl
  // is_debug_logging_enabled_for_tag -- skipped in dumpsys
  builder.add_logging_debug_enabled_for_all_is_enabled(initFlags::logging_debug_enabled_for_all_is_enabled());
  builder.add_pass_phy_update_callback_is_enabled(initFlags::pass_phy_update_callback_is_enabled());
  builder.add_queue_l2cap_coc_while_encrypting_is_enabled(initFlags::queue_l2cap_coc_while_encrypting_is_enabled());
  builder.add_sdp_serialization_is_enabled(initFlags::sdp_serialization_is_enabled());
  builder.add_sdp_skip_rnr_if_known_is_enabled(initFlags::sdp_skip_rnr_if_known_is_enabled());
  return builder.Finish();
+1 −0
Original line number Diff line number Diff line
@@ -218,6 +218,7 @@ init_flags!(
        irk_rotation,
        logging_debug_enabled_for_all,
        pass_phy_update_callback = true,
        queue_l2cap_coc_while_encrypting = true,
        sdp_serialization = true,
        sdp_skip_rnr_if_known = true,
    }
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ mod ffi {
        fn is_debug_logging_enabled_for_tag(tag: &str) -> bool;
        fn logging_debug_enabled_for_all_is_enabled() -> bool;
        fn pass_phy_update_callback_is_enabled() -> bool;
        fn queue_l2cap_coc_while_encrypting_is_enabled() -> bool;
        fn sdp_serialization_is_enabled() -> bool;
        fn sdp_skip_rnr_if_known_is_enabled() -> bool;
    }
+9 −2
Original line number Diff line number Diff line
@@ -991,10 +991,17 @@ tL2CAP_LE_RESULT_CODE btm_ble_start_sec_check(const RawAddress& bd_addr,
  }

  if (ble_sec_act == BTM_BLE_SEC_NONE) {
    if (bluetooth::common::init_flags::queue_l2cap_coc_while_encrypting_is_enabled()) {
      if (sec_act != BTM_SEC_ENC_PENDING) {
        return result;
      }

    } else {
      return result;
    }
  } else {
    l2cble_update_sec_act(bd_addr, sec_act);
  }

  BTM_SetEncryption(bd_addr, BT_TRANSPORT_LE, p_callback, p_ref_data,
                    ble_sec_act);