Loading system/gd/common/init_flags.fbs +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ attribute "privacy"; table InitFlagsData { title:string; gd_advertising_enabled:bool; gd_scanning_enabled:bool; gd_security_enabled:bool; gd_acl_enabled:bool; gd_hci_enabled:bool; Loading system/gd/dumpsys/init_flags.cc +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFl common::InitFlagsDataBuilder builder(*fb_builder); builder.add_title(title); builder.add_gd_advertising_enabled(bluetooth::common::init_flags::gd_advertising_is_enabled()); builder.add_gd_scanning_enabled(bluetooth::common::init_flags::gd_scanning_is_enabled()); 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(bluetooth::common::init_flags::gd_hci_is_enabled()); Loading system/gd/rust/common/src/init_flags.rs +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ init_flags!( flags: { gd_core, gd_advertising, gd_scanning, gd_security, gd_acl, gd_l2cap, Loading system/gd/rust/shim/src/init_flags.rs +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ mod ffi { fn gd_core_is_enabled() -> bool; fn gd_security_is_enabled() -> bool; fn gd_advertising_is_enabled() -> bool; fn gd_scanning_is_enabled() -> bool; fn gd_acl_is_enabled() -> bool; fn gd_l2cap_is_enabled() -> bool; fn gd_hci_is_enabled() -> bool; Loading system/main/shim/hci_layer.cc +20 −4 Original line number Diff line number Diff line Loading @@ -264,23 +264,24 @@ static bool subevent_already_registered_in_le_hci_layer( case bluetooth::hci::SubeventCode::REMOTE_CONNECTION_PARAMETER_REQUEST: return bluetooth::shim::is_gd_acl_enabled() || bluetooth::shim::is_gd_l2cap_enabled() || bluetooth::shim::is_gd_advertising_enabled(); bluetooth::shim::is_gd_advertising_enabled() || bluetooth::shim::is_gd_scanning_enabled(); case bluetooth::hci::SubeventCode::ADVERTISING_SET_TERMINATED: case bluetooth::hci::SubeventCode::SCAN_REQUEST_RECEIVED: return bluetooth::shim::is_gd_acl_enabled() || bluetooth::shim::is_gd_l2cap_enabled() || bluetooth::shim::is_gd_advertising_enabled(); case bluetooth::hci::SubeventCode::SCAN_TIMEOUT: case bluetooth::hci::SubeventCode::ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::DIRECTED_ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::EXTENDED_ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_SYNC_ESTABLISHED: case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_SYNC_LOST: // TODO return bluetooth::shim::is_gd_scanning_enabled(); return bluetooth::shim::is_gd_scanning_enabled(); case bluetooth::hci::SubeventCode::READ_REMOTE_FEATURES_COMPLETE: case bluetooth::hci::SubeventCode::READ_LOCAL_P256_PUBLIC_KEY_COMPLETE: case bluetooth::hci::SubeventCode::GENERATE_DHKEY_COMPLETE: case bluetooth::hci::SubeventCode::SCAN_TIMEOUT: case bluetooth::hci::SubeventCode::CHANNEL_SELECTION_ALGORITHM: case bluetooth::hci::SubeventCode::CONNECTIONLESS_IQ_REPORT: case bluetooth::hci::SubeventCode::CONNECTION_IQ_REPORT: Loading Loading @@ -313,6 +314,16 @@ static bool event_already_registered_in_le_advertising_manager( return false; } static bool event_already_registered_in_le_scanning_manager( bluetooth::hci::EventCode event_code) { for (auto event : bluetooth::hci::AclConnectionEvents) { if (event == event_code) { return bluetooth::shim::is_gd_scanning_enabled(); } } return false; } } // namespace namespace cpp { Loading Loading @@ -490,9 +501,10 @@ static void acl_data_callback() { static void register_for_acl() { hci_queue_end = bluetooth::shim::GetHciLayer()->GetAclQueueEnd(); // if gd advertising enabled, hci_queue_end will be register in // if gd advertising/scanning enabled, hci_queue_end will be register in // AclManager::impl::Start if (!bluetooth::shim::is_gd_advertising_enabled() && !bluetooth::shim::is_gd_scanning_enabled() && !bluetooth::shim::is_gd_l2cap_enabled()) { hci_queue_end->RegisterDequeue(bluetooth::shim::GetGdShimHandler(), bluetooth::common::Bind(acl_data_callback)); Loading Loading @@ -523,6 +535,8 @@ static void on_shutting_down() { } else if (event_already_registered_in_le_advertising_manager( event_code)) { continue; } else if (event_already_registered_in_le_scanning_manager(event_code)) { continue; } bluetooth::shim::GetHciLayer()->UnregisterEventHandler(event_code); } Loading Loading @@ -707,6 +721,8 @@ void bluetooth::shim::hci_on_reset_complete() { continue; } else if (event_already_registered_in_le_advertising_manager(event_code)) { continue; } else if (event_already_registered_in_le_scanning_manager(event_code)) { continue; } if (bluetooth::common::init_flags::gd_rust_is_enabled()) { Loading Loading
system/gd/common/init_flags.fbs +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ attribute "privacy"; table InitFlagsData { title:string; gd_advertising_enabled:bool; gd_scanning_enabled:bool; gd_security_enabled:bool; gd_acl_enabled:bool; gd_hci_enabled:bool; Loading
system/gd/dumpsys/init_flags.cc +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFl common::InitFlagsDataBuilder builder(*fb_builder); builder.add_title(title); builder.add_gd_advertising_enabled(bluetooth::common::init_flags::gd_advertising_is_enabled()); builder.add_gd_scanning_enabled(bluetooth::common::init_flags::gd_scanning_is_enabled()); 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(bluetooth::common::init_flags::gd_hci_is_enabled()); Loading
system/gd/rust/common/src/init_flags.rs +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ init_flags!( flags: { gd_core, gd_advertising, gd_scanning, gd_security, gd_acl, gd_l2cap, Loading
system/gd/rust/shim/src/init_flags.rs +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ mod ffi { fn gd_core_is_enabled() -> bool; fn gd_security_is_enabled() -> bool; fn gd_advertising_is_enabled() -> bool; fn gd_scanning_is_enabled() -> bool; fn gd_acl_is_enabled() -> bool; fn gd_l2cap_is_enabled() -> bool; fn gd_hci_is_enabled() -> bool; Loading
system/main/shim/hci_layer.cc +20 −4 Original line number Diff line number Diff line Loading @@ -264,23 +264,24 @@ static bool subevent_already_registered_in_le_hci_layer( case bluetooth::hci::SubeventCode::REMOTE_CONNECTION_PARAMETER_REQUEST: return bluetooth::shim::is_gd_acl_enabled() || bluetooth::shim::is_gd_l2cap_enabled() || bluetooth::shim::is_gd_advertising_enabled(); bluetooth::shim::is_gd_advertising_enabled() || bluetooth::shim::is_gd_scanning_enabled(); case bluetooth::hci::SubeventCode::ADVERTISING_SET_TERMINATED: case bluetooth::hci::SubeventCode::SCAN_REQUEST_RECEIVED: return bluetooth::shim::is_gd_acl_enabled() || bluetooth::shim::is_gd_l2cap_enabled() || bluetooth::shim::is_gd_advertising_enabled(); case bluetooth::hci::SubeventCode::SCAN_TIMEOUT: case bluetooth::hci::SubeventCode::ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::DIRECTED_ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::EXTENDED_ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_REPORT: case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_SYNC_ESTABLISHED: case bluetooth::hci::SubeventCode::PERIODIC_ADVERTISING_SYNC_LOST: // TODO return bluetooth::shim::is_gd_scanning_enabled(); return bluetooth::shim::is_gd_scanning_enabled(); case bluetooth::hci::SubeventCode::READ_REMOTE_FEATURES_COMPLETE: case bluetooth::hci::SubeventCode::READ_LOCAL_P256_PUBLIC_KEY_COMPLETE: case bluetooth::hci::SubeventCode::GENERATE_DHKEY_COMPLETE: case bluetooth::hci::SubeventCode::SCAN_TIMEOUT: case bluetooth::hci::SubeventCode::CHANNEL_SELECTION_ALGORITHM: case bluetooth::hci::SubeventCode::CONNECTIONLESS_IQ_REPORT: case bluetooth::hci::SubeventCode::CONNECTION_IQ_REPORT: Loading Loading @@ -313,6 +314,16 @@ static bool event_already_registered_in_le_advertising_manager( return false; } static bool event_already_registered_in_le_scanning_manager( bluetooth::hci::EventCode event_code) { for (auto event : bluetooth::hci::AclConnectionEvents) { if (event == event_code) { return bluetooth::shim::is_gd_scanning_enabled(); } } return false; } } // namespace namespace cpp { Loading Loading @@ -490,9 +501,10 @@ static void acl_data_callback() { static void register_for_acl() { hci_queue_end = bluetooth::shim::GetHciLayer()->GetAclQueueEnd(); // if gd advertising enabled, hci_queue_end will be register in // if gd advertising/scanning enabled, hci_queue_end will be register in // AclManager::impl::Start if (!bluetooth::shim::is_gd_advertising_enabled() && !bluetooth::shim::is_gd_scanning_enabled() && !bluetooth::shim::is_gd_l2cap_enabled()) { hci_queue_end->RegisterDequeue(bluetooth::shim::GetGdShimHandler(), bluetooth::common::Bind(acl_data_callback)); Loading Loading @@ -523,6 +535,8 @@ static void on_shutting_down() { } else if (event_already_registered_in_le_advertising_manager( event_code)) { continue; } else if (event_already_registered_in_le_scanning_manager(event_code)) { continue; } bluetooth::shim::GetHciLayer()->UnregisterEventHandler(event_code); } Loading Loading @@ -707,6 +721,8 @@ void bluetooth::shim::hci_on_reset_complete() { continue; } else if (event_already_registered_in_le_advertising_manager(event_code)) { continue; } else if (event_already_registered_in_le_scanning_manager(event_code)) { continue; } if (bluetooth::common::init_flags::gd_rust_is_enabled()) { Loading