Loading system/bta/dm/bta_dm_act.cc +7 −4 Original line number Original line Diff line number Diff line Loading @@ -50,6 +50,7 @@ #include "stack/gatt/connection_manager.h" #include "stack/gatt/connection_manager.h" #include "stack/include/gatt_api.h" #include "stack/include/gatt_api.h" #include "utl.h" #include "utl.h" #include "device/include/interop.h" #if (GAP_INCLUDED == TRUE) #if (GAP_INCLUDED == TRUE) #include "gap_api.h" #include "gap_api.h" Loading Loading @@ -1945,10 +1946,12 @@ static void bta_dm_discover_device(const RawAddress& remote_bd_addr) { APPL_TRACE_DEBUG("%s appl_knows_rem_name %d", __func__, APPL_TRACE_DEBUG("%s appl_knows_rem_name %d", __func__, bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name); bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name); } } if ((bta_dm_search_cb.p_btm_inq_info) && if (((bta_dm_search_cb.p_btm_inq_info) && (bta_dm_search_cb.p_btm_inq_info->results.device_type == (bta_dm_search_cb.p_btm_inq_info->results.device_type == BT_DEVICE_TYPE_BLE) && BT_DEVICE_TYPE_BLE) && (bta_dm_search_cb.state == BTA_DM_SEARCH_ACTIVE)) { (bta_dm_search_cb.state == BTA_DM_SEARCH_ACTIVE)) || (transport == BT_TRANSPORT_LE && interop_match_addr(INTEROP_DISABLE_NAME_REQUEST, &bta_dm_search_cb.peer_bdaddr))) { /* Do not perform RNR for LE devices at inquiry complete*/ /* Do not perform RNR for LE devices at inquiry complete*/ bta_dm_search_cb.name_discover_done = true; bta_dm_search_cb.name_discover_done = true; } } Loading system/device/include/interop.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -94,6 +94,12 @@ typedef enum { // Set a very low initial sniff subrating for HID devices that do not // Set a very low initial sniff subrating for HID devices that do not // set their own sniff interval. // set their own sniff interval. INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, // Disable remote name requst for some devices. // The public address of these devices are same as the Random address in ADV. // Then will get name by LE_Create_connection, actually fails, // but will block pairing. INTEROP_DISABLE_NAME_REQUEST } interop_feature_t; } interop_feature_t; // Check if a given |addr| matches a known interoperability workaround as // Check if a given |addr| matches a known interoperability workaround as Loading system/device/include/interop_database.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -146,6 +146,10 @@ static const interop_addr_entry_t interop_addr_database[] = { // AirPods 2 - unacceptably loud volume // AirPods 2 - unacceptably loud volume {{{0x9c, 0x64, 0x8b, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, {{{0x9c, 0x64, 0x8b, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, // for skip name request, // because BR/EDR address and ADV random address are the same {{{0xd4, 0x7a, 0xe2, 0, 0, 0}}, 3, INTEROP_DISABLE_NAME_REQUEST}, }; }; typedef struct { typedef struct { Loading system/device/src/interop.cc +1 −0 Original line number Original line Diff line number Diff line Loading @@ -131,6 +131,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) CASE_RETURN_STR(INTEROP_DISABLE_NAME_REQUEST) } } return "UNKNOWN"; return "UNKNOWN"; Loading system/gd/common/address.h +11 −0 Original line number Original line Diff line number Diff line Loading @@ -79,3 +79,14 @@ inline std::ostream& operator<<(std::ostream& os, const Address& a) { } // namespace common } // namespace common } // namespace bluetooth } // namespace bluetooth namespace std { template <> struct hash<bluetooth::common::Address> { std::size_t operator()(const bluetooth::common::Address& val) const { uint64_t int_addr = 0; memcpy(reinterpret_cast<uint8_t*>(&int_addr), val.address, bluetooth::common::Address::kLength); return std::hash<uint64_t>{}(int_addr); } }; } // namespace std No newline at end of file Loading
system/bta/dm/bta_dm_act.cc +7 −4 Original line number Original line Diff line number Diff line Loading @@ -50,6 +50,7 @@ #include "stack/gatt/connection_manager.h" #include "stack/gatt/connection_manager.h" #include "stack/include/gatt_api.h" #include "stack/include/gatt_api.h" #include "utl.h" #include "utl.h" #include "device/include/interop.h" #if (GAP_INCLUDED == TRUE) #if (GAP_INCLUDED == TRUE) #include "gap_api.h" #include "gap_api.h" Loading Loading @@ -1945,10 +1946,12 @@ static void bta_dm_discover_device(const RawAddress& remote_bd_addr) { APPL_TRACE_DEBUG("%s appl_knows_rem_name %d", __func__, APPL_TRACE_DEBUG("%s appl_knows_rem_name %d", __func__, bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name); bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name); } } if ((bta_dm_search_cb.p_btm_inq_info) && if (((bta_dm_search_cb.p_btm_inq_info) && (bta_dm_search_cb.p_btm_inq_info->results.device_type == (bta_dm_search_cb.p_btm_inq_info->results.device_type == BT_DEVICE_TYPE_BLE) && BT_DEVICE_TYPE_BLE) && (bta_dm_search_cb.state == BTA_DM_SEARCH_ACTIVE)) { (bta_dm_search_cb.state == BTA_DM_SEARCH_ACTIVE)) || (transport == BT_TRANSPORT_LE && interop_match_addr(INTEROP_DISABLE_NAME_REQUEST, &bta_dm_search_cb.peer_bdaddr))) { /* Do not perform RNR for LE devices at inquiry complete*/ /* Do not perform RNR for LE devices at inquiry complete*/ bta_dm_search_cb.name_discover_done = true; bta_dm_search_cb.name_discover_done = true; } } Loading
system/device/include/interop.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -94,6 +94,12 @@ typedef enum { // Set a very low initial sniff subrating for HID devices that do not // Set a very low initial sniff subrating for HID devices that do not // set their own sniff interval. // set their own sniff interval. INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL, // Disable remote name requst for some devices. // The public address of these devices are same as the Random address in ADV. // Then will get name by LE_Create_connection, actually fails, // but will block pairing. INTEROP_DISABLE_NAME_REQUEST } interop_feature_t; } interop_feature_t; // Check if a given |addr| matches a known interoperability workaround as // Check if a given |addr| matches a known interoperability workaround as Loading
system/device/include/interop_database.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -146,6 +146,10 @@ static const interop_addr_entry_t interop_addr_database[] = { // AirPods 2 - unacceptably loud volume // AirPods 2 - unacceptably loud volume {{{0x9c, 0x64, 0x8b, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, {{{0x9c, 0x64, 0x8b, 0, 0, 0}}, 3, INTEROP_DISABLE_ABSOLUTE_VOLUME}, // for skip name request, // because BR/EDR address and ADV random address are the same {{{0xd4, 0x7a, 0xe2, 0, 0, 0}}, 3, INTEROP_DISABLE_NAME_REQUEST}, }; }; typedef struct { typedef struct { Loading
system/device/src/interop.cc +1 −0 Original line number Original line Diff line number Diff line Loading @@ -131,6 +131,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DYNAMIC_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_DISABLE_ROLE_SWITCH) CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) CASE_RETURN_STR(INTEROP_HID_HOST_LIMIT_SNIFF_INTERVAL) CASE_RETURN_STR(INTEROP_DISABLE_NAME_REQUEST) } } return "UNKNOWN"; return "UNKNOWN"; Loading
system/gd/common/address.h +11 −0 Original line number Original line Diff line number Diff line Loading @@ -79,3 +79,14 @@ inline std::ostream& operator<<(std::ostream& os, const Address& a) { } // namespace common } // namespace common } // namespace bluetooth } // namespace bluetooth namespace std { template <> struct hash<bluetooth::common::Address> { std::size_t operator()(const bluetooth::common::Address& val) const { uint64_t int_addr = 0; memcpy(reinterpret_cast<uint8_t*>(&int_addr), val.address, bluetooth::common::Address::kLength); return std::hash<uint64_t>{}(int_addr); } }; } // namespace std No newline at end of file