Loading system/device/include/interop.h +4 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,10 @@ typedef enum { // It is required for some devices to provide sound. INTEROP_INSERT_CALL_WHEN_SCO_START, // Some device need the host to delay authentication process to avoid // collision. INTEROP_DELAY_AUTH, END_OF_INTEROP_LIST } interop_feature_t; Loading system/device/src/interop.cc +1 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_IGNORE_DISC_BEFORE_SIGNALLING_TIMEOUT); CASE_RETURN_STR(INTEROP_SUSPEND_ATT_TRAFFIC_DURING_PAIRING); CASE_RETURN_STR(INTEROP_INSERT_CALL_WHEN_SCO_START); CASE_RETURN_STR(INTEROP_DELAY_AUTH); } return UNKNOWN_INTEROP_FEATURE; } Loading system/stack/btm/btm_sec.cc +9 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include "common/time_util.h" #include "device/include/controller.h" #include "device/include/device_iot_config.h" #include "device/include/interop.h" #include "internal_include/bt_target.h" #include "l2c_api.h" #include "osi/include/allocator.h" Loading Loading @@ -80,6 +81,7 @@ constexpr char kBtmLogTag[] = "SEC"; extern tBTM_CB btm_cb; #define BTM_SEC_MAX_COLLISION_DELAY (5000) #define BTM_SEC_START_AUTH_DELAY (200) #define BTM_SEC_IS_SM4(sm) ((bool)(BTM_SM4_TRUE == ((sm)&BTM_SM4_TRUE))) #define BTM_SEC_IS_SM4_LEGACY(sm) ((bool)(BTM_SM4_KNOWN == ((sm)&BTM_SM4_TRUE))) Loading Loading @@ -4487,10 +4489,15 @@ static bool btm_sec_start_get_name(tBTM_SEC_DEV_REC* p_dev_rec) { ******************************************************************************/ static void btm_sec_wait_and_start_authentication(tBTM_SEC_DEV_REC* p_dev_rec) { auto addr = new RawAddress(p_dev_rec->bd_addr); static const int32_t delay_auth = int32_t delay_auth = osi_property_get_int32("bluetooth.btm.sec.delay_auth_ms.value", 0); /* Overwrite the system-wide authentication delay if device-specific * interoperability delay is needed. */ if (interop_match_addr(INTEROP_DELAY_AUTH, addr)) { delay_auth = BTM_SEC_START_AUTH_DELAY; } bt_status_t status = do_in_main_thread_delayed( FROM_HERE, base::Bind(&btm_sec_auth_timer_timeout, addr), std::chrono::milliseconds(delay_auth)); Loading Loading
system/device/include/interop.h +4 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,10 @@ typedef enum { // It is required for some devices to provide sound. INTEROP_INSERT_CALL_WHEN_SCO_START, // Some device need the host to delay authentication process to avoid // collision. INTEROP_DELAY_AUTH, END_OF_INTEROP_LIST } interop_feature_t; Loading
system/device/src/interop.cc +1 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_IGNORE_DISC_BEFORE_SIGNALLING_TIMEOUT); CASE_RETURN_STR(INTEROP_SUSPEND_ATT_TRAFFIC_DURING_PAIRING); CASE_RETURN_STR(INTEROP_INSERT_CALL_WHEN_SCO_START); CASE_RETURN_STR(INTEROP_DELAY_AUTH); } return UNKNOWN_INTEROP_FEATURE; } Loading
system/stack/btm/btm_sec.cc +9 −2 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include "common/time_util.h" #include "device/include/controller.h" #include "device/include/device_iot_config.h" #include "device/include/interop.h" #include "internal_include/bt_target.h" #include "l2c_api.h" #include "osi/include/allocator.h" Loading Loading @@ -80,6 +81,7 @@ constexpr char kBtmLogTag[] = "SEC"; extern tBTM_CB btm_cb; #define BTM_SEC_MAX_COLLISION_DELAY (5000) #define BTM_SEC_START_AUTH_DELAY (200) #define BTM_SEC_IS_SM4(sm) ((bool)(BTM_SM4_TRUE == ((sm)&BTM_SM4_TRUE))) #define BTM_SEC_IS_SM4_LEGACY(sm) ((bool)(BTM_SM4_KNOWN == ((sm)&BTM_SM4_TRUE))) Loading Loading @@ -4487,10 +4489,15 @@ static bool btm_sec_start_get_name(tBTM_SEC_DEV_REC* p_dev_rec) { ******************************************************************************/ static void btm_sec_wait_and_start_authentication(tBTM_SEC_DEV_REC* p_dev_rec) { auto addr = new RawAddress(p_dev_rec->bd_addr); static const int32_t delay_auth = int32_t delay_auth = osi_property_get_int32("bluetooth.btm.sec.delay_auth_ms.value", 0); /* Overwrite the system-wide authentication delay if device-specific * interoperability delay is needed. */ if (interop_match_addr(INTEROP_DELAY_AUTH, addr)) { delay_auth = BTM_SEC_START_AUTH_DELAY; } bt_status_t status = do_in_main_thread_delayed( FROM_HERE, base::Bind(&btm_sec_auth_timer_timeout, addr), std::chrono::milliseconds(delay_auth)); Loading