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

Commit 3448185e authored by Yun-Hao Chung's avatar Yun-Hao Chung Committed by Yun-hao Chung
Browse files

Add sysprop to configure auto flush timeout

Some vendor suggests that auto flushable timeout should be used to
mitigate the no NOCP issue.

This CL sets the defined auto flush timeout after all remote features
are read.

Bug: 334752513
Test: mmm packages/modules/Bluetooth
Test: manually test
Change-Id: Ic0c7b716bd1d294dd2914b44690cd2d19008caeb
parent 1ef1ee91
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ void SyspropsModule::parse_config(std::string file_path) {
          "bluetooth.core.classic.sniff_min_intervals",
          "bluetooth.core.classic.sniff_attempts",
          "bluetooth.core.classic.sniff_timeouts",
          "bluetooth.core.classic.auto_flush_timeout",
          // LE
          "bluetooth.core.le.min_connection_interval",
          "bluetooth.core.le.max_connection_interval",
+8 −0
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@
#define PROPERTY_LINK_SUPERVISION_TIMEOUT "bluetooth.core.acl.link_supervision_timeout"
#endif

#ifndef PROPERTY_AUTO_FLUSH_TIMEOUT
#define PROPERTY_AUTO_FLUSH_TIMEOUT "bluetooth.core.classic.auto_flush_timeout"
#endif

using namespace bluetooth;
using bluetooth::legacy::hci::GetInterface;

@@ -185,6 +189,10 @@ void NotifyAclRoleSwitchComplete(const RawAddress& bda, tHCI_ROLE new_role,
void NotifyAclFeaturesReadComplete(tACL_CONN& p_acl, uint8_t max_page_number) {
  btm_process_remote_ext_features(&p_acl, max_page_number);
  btm_set_link_policy(&p_acl, btm_cb.acl_cb_.DefaultLinkPolicy());
  int32_t flush_timeout = osi_property_get_int32(PROPERTY_AUTO_FLUSH_TIMEOUT, 0);
  if (flush_timeout != 0) {
    acl_write_automatic_flush_timeout(p_acl.remote_addr, static_cast<uint16_t>(flush_timeout));
  }
  BTA_dm_notify_remote_features_complete(p_acl.remote_addr);
}