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

Commit 1c02eb8b authored by Chris Manton's avatar Chris Manton
Browse files

Final removal of gd_controller_enabled flag

Bug: 197478351
Tag: #refactor
Test: gd/cert/run

Change-Id: I84824727d7125df15a08a2a450ed2431ff9874c1
parent d8e616de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFl
  builder.add_gd_security_enabled(bluetooth::common::init_flags::gd_security_is_enabled());
  builder.add_gd_acl_enabled(bluetooth::common::init_flags::gd_acl_is_enabled());
  builder.add_gd_hci_enabled(true);
  builder.add_gd_controller_enabled(bluetooth::common::init_flags::gd_controller_is_enabled());
  builder.add_gd_controller_enabled(true);
  builder.add_gd_core_enabled(bluetooth::common::init_flags::gd_core_is_enabled());
  builder.add_btaa_hci_log_enabled(bluetooth::common::init_flags::btaa_hci_is_enabled());
  return builder.Finish();
+0 −3
Original line number Diff line number Diff line
@@ -3,9 +3,6 @@ use paste::paste;
use std::sync::Mutex;

/// Deprecated immutable flag
pub fn gd_controller_is_enabled() -> bool {
    true
}

macro_rules! init_flags {
    (flags: { $($flag:ident),* }, dependencies: { $($parent:ident => $child:ident),* }) => {
+0 −1
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ mod ffi {
        fn gd_scanning_is_enabled() -> bool;
        fn gd_acl_is_enabled() -> bool;
        fn gd_l2cap_is_enabled() -> bool;
        fn gd_controller_is_enabled() -> bool;
        fn gatt_robust_caching_is_enabled() -> bool;
        fn btaa_hci_is_enabled() -> bool;
        fn gd_rust_is_enabled() -> bool;
+0 −1
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ pub fn get_hci(stack: &mut Stack) -> Box<Hci> {

pub fn get_controller(stack: &mut Stack) -> Box<Controller> {
    assert!(init_flags::gd_rust_is_enabled());
    assert!(init_flags::gd_controller_is_enabled());

    Box::new(Controller(stack.get_blocking::<Arc<ControllerExports>>()))
}
+3 −7
Original line number Diff line number Diff line
@@ -114,10 +114,8 @@ void Stack::StartEverything() {
    rust::stack_start(**rust_stack_);

    rust_hci_ = new ::rust::Box<rust::Hci>(rust::get_hci(**rust_stack_));
    if (common::init_flags::gd_controller_is_enabled()) {
      rust_controller_ = new ::rust::Box<rust::Controller>(
          rust::get_controller(**rust_stack_));
    }
    rust_controller_ =
        new ::rust::Box<rust::Controller>(rust::get_controller(**rust_stack_));
    bluetooth::shim::hci_on_reset_complete();

    // Create pid since we're up and running
@@ -136,9 +134,7 @@ void Stack::StartEverything() {
  modules.add<shim::Dumpsys>();
  modules.add<hci::VendorSpecificEventManager>();

  if (common::init_flags::gd_controller_is_enabled()) {
  modules.add<hci::Controller>();
  }
  if (common::init_flags::gd_acl_is_enabled()) {
    modules.add<hci::AclManager>();
  }