Loading system/btif/src/stack_manager.cc +4 −5 Original line number Original line Diff line number Diff line Loading @@ -61,15 +61,12 @@ #include "bta/dm/bta_dm_int.h" #include "bta/dm/bta_dm_int.h" #include "device/include/interop.h" #include "device/include/interop.h" #include "internal_include/stack_config.h" #include "internal_include/stack_config.h" #include "os/system_properties.h" #include "rust/src/core/ffi/module.h" #include "rust/src/core/ffi/module.h" #include "stack/btm/btm_ble_int.h" #include "stack/btm/btm_ble_int.h" #include "stack/include/ais_api.h" #include "stack/include/ais_api.h" #include "stack/include/smp_api.h" #include "stack/include/smp_api.h" #ifndef BT_STACK_CLEANUP_WAIT_MS #define BT_STACK_CLEANUP_WAIT_MS 1000 #endif // Validate or respond to various conditional compilation flags // Validate or respond to various conditional compilation flags // Once BTA_PAN_INCLUDED is no longer exposed via bt_target.h // Once BTA_PAN_INCLUDED is no longer exposed via bt_target.h Loading Loading @@ -173,7 +170,9 @@ static void clean_up_stack(ProfileStopCallback stopProfiles) { management_thread.DoInThread( management_thread.DoInThread( FROM_HERE, base::BindOnce(event_clean_up_stack, std::move(promise), stopProfiles)); FROM_HERE, base::BindOnce(event_clean_up_stack, std::move(promise), stopProfiles)); auto status = future.wait_for(std::chrono::milliseconds(BT_STACK_CLEANUP_WAIT_MS)); auto status = future.wait_for(std::chrono::milliseconds( bluetooth::os::GetSystemPropertyUint32("bluetooth.cleanup_timeout", /* default_value = */ 1000))); if (status == std::future_status::ready) { if (status == std::future_status::ready) { management_thread.ShutDown(); management_thread.ShutDown(); } else { } else { Loading system/gd/os/chromeos/system_properties.cc +4 −1 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,10 @@ std::mutex properties_mutex; // Properties set along with some default values for Floss. // Properties set along with some default values for Floss. std::unordered_map<std::string, std::string> properties = { std::unordered_map<std::string, std::string> properties = { {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.gd.start_timeout", "12000"}}; {"bluetooth.gd.start_timeout", "12000"}, {"bluetooth.gd.stop_timeout", "12000"}, /* HCI Reset timeout: 10s + Default cleanup timeout: 1s = 11s */ {"bluetooth.cleanup_timeout", "11000"}}; } // namespace } // namespace std::optional<std::string> GetSystemProperty(const std::string& property) { std::optional<std::string> GetSystemProperty(const std::string& property) { Loading system/gd/os/linux/system_properties.cc +4 −1 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,10 @@ std::mutex properties_mutex; // Properties set along with some default values for Floss. // Properties set along with some default values for Floss. std::unordered_map<std::string, std::string> properties = { std::unordered_map<std::string, std::string> properties = { {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.gd.start_timeout", "12000"}}; {"bluetooth.gd.start_timeout", "12000"}, {"bluetooth.gd.stop_timeout", "12000"}, /* HCI Reset timeout: 10s + Default cleanup timeout: 1s = 11s */ {"bluetooth.cleanup_timeout", "11000"}}; } // namespace } // namespace std::optional<std::string> GetSystemProperty(const std::string& property) { std::optional<std::string> GetSystemProperty(const std::string& property) { Loading system/gd/rust/linux/service/src/main.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,7 @@ const ADMIN_SETTINGS_FILE_PATH: &str = "/var/lib/bluetooth/admin_policy.json"; // and BTA_DM_DISABLE_TIMER_RETRIAL_MS // and BTA_DM_DISABLE_TIMER_RETRIAL_MS const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); // Time bt_stack_manager waits for cleanup // Time bt_stack_manager waits for cleanup const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(1000); const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(11000); // Time bt_stack_manager waits for cleanup profiles // Time bt_stack_manager waits for cleanup profiles const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); // Extra time to wait before terminating the process // Extra time to wait before terminating the process Loading Loading
system/btif/src/stack_manager.cc +4 −5 Original line number Original line Diff line number Diff line Loading @@ -61,15 +61,12 @@ #include "bta/dm/bta_dm_int.h" #include "bta/dm/bta_dm_int.h" #include "device/include/interop.h" #include "device/include/interop.h" #include "internal_include/stack_config.h" #include "internal_include/stack_config.h" #include "os/system_properties.h" #include "rust/src/core/ffi/module.h" #include "rust/src/core/ffi/module.h" #include "stack/btm/btm_ble_int.h" #include "stack/btm/btm_ble_int.h" #include "stack/include/ais_api.h" #include "stack/include/ais_api.h" #include "stack/include/smp_api.h" #include "stack/include/smp_api.h" #ifndef BT_STACK_CLEANUP_WAIT_MS #define BT_STACK_CLEANUP_WAIT_MS 1000 #endif // Validate or respond to various conditional compilation flags // Validate or respond to various conditional compilation flags // Once BTA_PAN_INCLUDED is no longer exposed via bt_target.h // Once BTA_PAN_INCLUDED is no longer exposed via bt_target.h Loading Loading @@ -173,7 +170,9 @@ static void clean_up_stack(ProfileStopCallback stopProfiles) { management_thread.DoInThread( management_thread.DoInThread( FROM_HERE, base::BindOnce(event_clean_up_stack, std::move(promise), stopProfiles)); FROM_HERE, base::BindOnce(event_clean_up_stack, std::move(promise), stopProfiles)); auto status = future.wait_for(std::chrono::milliseconds(BT_STACK_CLEANUP_WAIT_MS)); auto status = future.wait_for(std::chrono::milliseconds( bluetooth::os::GetSystemPropertyUint32("bluetooth.cleanup_timeout", /* default_value = */ 1000))); if (status == std::future_status::ready) { if (status == std::future_status::ready) { management_thread.ShutDown(); management_thread.ShutDown(); } else { } else { Loading
system/gd/os/chromeos/system_properties.cc +4 −1 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,10 @@ std::mutex properties_mutex; // Properties set along with some default values for Floss. // Properties set along with some default values for Floss. std::unordered_map<std::string, std::string> properties = { std::unordered_map<std::string, std::string> properties = { {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.gd.start_timeout", "12000"}}; {"bluetooth.gd.start_timeout", "12000"}, {"bluetooth.gd.stop_timeout", "12000"}, /* HCI Reset timeout: 10s + Default cleanup timeout: 1s = 11s */ {"bluetooth.cleanup_timeout", "11000"}}; } // namespace } // namespace std::optional<std::string> GetSystemProperty(const std::string& property) { std::optional<std::string> GetSystemProperty(const std::string& property) { Loading
system/gd/os/linux/system_properties.cc +4 −1 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,10 @@ std::mutex properties_mutex; // Properties set along with some default values for Floss. // Properties set along with some default values for Floss. std::unordered_map<std::string, std::string> properties = { std::unordered_map<std::string, std::string> properties = { {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.profile.avrcp.target.enabled", "true"}, {"bluetooth.gd.start_timeout", "12000"}}; {"bluetooth.gd.start_timeout", "12000"}, {"bluetooth.gd.stop_timeout", "12000"}, /* HCI Reset timeout: 10s + Default cleanup timeout: 1s = 11s */ {"bluetooth.cleanup_timeout", "11000"}}; } // namespace } // namespace std::optional<std::string> GetSystemProperty(const std::string& property) { std::optional<std::string> GetSystemProperty(const std::string& property) { Loading
system/gd/rust/linux/service/src/main.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,7 @@ const ADMIN_SETTINGS_FILE_PATH: &str = "/var/lib/bluetooth/admin_policy.json"; // and BTA_DM_DISABLE_TIMER_RETRIAL_MS // and BTA_DM_DISABLE_TIMER_RETRIAL_MS const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000); // Time bt_stack_manager waits for cleanup // Time bt_stack_manager waits for cleanup const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(1000); const STACK_CLEANUP_TIMEOUT_MS: Duration = Duration::from_millis(11000); // Time bt_stack_manager waits for cleanup profiles // Time bt_stack_manager waits for cleanup profiles const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); const STACK_CLEANUP_PROFILES_TIMEOUT_MS: Duration = Duration::from_millis(100); // Extra time to wait before terminating the process // Extra time to wait before terminating the process Loading