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

Commit b53199c9 authored by Rahul Arya's avatar Rahul Arya
Browse files

[Connection Manager] Call into connection manager from C++

We are basically taking all the old entry points for the C++ connection manager,
as well as all other entrypoints into le_impl, and sending them to Rust instead.

Note that APIs are not implemented and so will crash on invocation.

Bug: 272572974
Test: compiles
Change-Id: I918d0ede0f42c74e1d00082c97854b0359b57ef6
parent 64de3903
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ table InitFlagsData {
    set_min_encryption_is_enabled:bool (privacy:"Any");
    subrating_is_enabled:bool (privacy:"Any");
    trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled:bool (privacy:"Any");
    use_unified_connection_manager_is_enabled:bool (privacy:"Any");
}
// LINT.ThenChange(/system/gd/dumpsys/init_flags.cc)

+2 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@ flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFl
  builder.add_subrating_is_enabled(initFlags::subrating_is_enabled());
  builder.add_trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled(
      initFlags::trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled());
  builder.add_use_unified_connection_manager_is_enabled(
      initFlags::use_unified_connection_manager_is_enabled());

  return builder.Finish();
}
+1 −0
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ init_flags!(
        set_min_encryption = true,
        subrating = true,
        trigger_advertising_callbacks_on_first_resume_after_pause = true,
        use_unified_connection_manager,
    }
    // dynamic flags can be updated at runtime and should be accessed directly
    // to check.
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ mod ffi {
        fn set_min_encryption_is_enabled() -> bool;
        fn subrating_is_enabled() -> bool;
        fn trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled() -> bool;
        fn use_unified_connection_manager_is_enabled() -> bool;
    }
}

+3 −1
Original line number Diff line number Diff line
@@ -1046,7 +1046,9 @@ struct shim::legacy::Acl::impl {
    if (connection != handle_to_le_connection_map_.end()) {
      auto remote_address_with_type =
          connection->second->GetRemoteAddressWithType();
      if (!common::init_flags::use_unified_connection_manager_is_enabled()) {
        GetAclManager()->RemoveFromBackgroundList(remote_address_with_type);
      }
      connection->second->InitiateDisconnect(
          ToDisconnectReasonFromLegacy(reason));
      LOG_DEBUG("Disconnection initiated le remote:%s handle:%hu",
Loading