Loading system/bta/dm/bta_dm_sec_api.cc +10 −1 Original line number Diff line number Diff line Loading @@ -211,7 +211,16 @@ void BTA_DmBleConfirmReply(const RawAddress& bd_addr, bool accept) { * ******************************************************************************/ void BTA_DmBleSecurityGrant(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res) { BTM_SecurityGrant(bd_addr, res); const tBTM_STATUS btm_status = [](const tBTA_DM_BLE_SEC_GRANT res) -> tBTM_STATUS { switch (res) { case tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_GRANTED: return BTM_SUCCESS; case tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT: return static_cast<tBTM_STATUS>(BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT); } }(res); BTM_SecurityGrant(bd_addr, btm_status); } /******************************************************************************* Loading system/bta/include/bta_sec_api.h +5 −7 Original line number Diff line number Diff line Loading @@ -24,16 +24,13 @@ #include <cstdint> #include "bta_api_data_types.h" #include "internal_include/bt_target.h" #include "bta/include/bta_api_data_types.h" #include "stack/include/bt_device_type.h" #include "stack/include/bt_name.h" #include "stack/include/bt_octets.h" #include "stack/include/btm_ble_sec_api_types.h" #include "stack/include/btm_sec_api_types.h" #include "stack/include/hci_error_code.h" #include "types/ble_address_with_type.h" #include "types/bt_transport.h" #include "types/raw_address.h" /* Security Setting Mask */ Loading Loading @@ -117,9 +114,10 @@ typedef struct { Octet16 dhk; } tBTA_BLE_LOCAL_ID_KEYS; #define BTA_DM_SEC_GRANTED BTA_SUCCESS #define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT typedef uint8_t tBTA_DM_BLE_SEC_GRANT; enum class tBTA_DM_BLE_SEC_GRANT { BTA_DM_SEC_GRANTED = BTA_SUCCESS, BTA_DM_SEC_PAIR_NOT_SPT = BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT }; /* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */ typedef struct { Loading system/btif/src/btif_dm.cc +3 −3 Original line number Diff line number Diff line Loading @@ -2523,7 +2523,7 @@ void btif_dm_cancel_bond(const RawAddress bd_addr) { if (is_bonding_or_sdp()) { if (pairing_cb.is_ssp) { if (pairing_cb.is_le_only) { BTA_DmBleSecurityGrant(bd_addr, BTA_DM_SEC_PAIR_NOT_SPT); BTA_DmBleSecurityGrant(bd_addr, tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT); } else { BTA_DmConfirm(bd_addr, false); BTA_DmBondCancel(bd_addr); Loading Loading @@ -2645,9 +2645,9 @@ void btif_dm_ssp_reply(const RawAddress bd_addr, bt_ssp_variant_t variant, uint8 BTA_DmBleConfirmReply(bd_addr, accept); } else { if (accept) { BTA_DmBleSecurityGrant(bd_addr, BTA_DM_SEC_GRANTED); BTA_DmBleSecurityGrant(bd_addr, tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_GRANTED); } else { BTA_DmBleSecurityGrant(bd_addr, BTA_DM_SEC_PAIR_NOT_SPT); BTA_DmBleSecurityGrant(bd_addr, tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT); } } } else { Loading Loading
system/bta/dm/bta_dm_sec_api.cc +10 −1 Original line number Diff line number Diff line Loading @@ -211,7 +211,16 @@ void BTA_DmBleConfirmReply(const RawAddress& bd_addr, bool accept) { * ******************************************************************************/ void BTA_DmBleSecurityGrant(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res) { BTM_SecurityGrant(bd_addr, res); const tBTM_STATUS btm_status = [](const tBTA_DM_BLE_SEC_GRANT res) -> tBTM_STATUS { switch (res) { case tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_GRANTED: return BTM_SUCCESS; case tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT: return static_cast<tBTM_STATUS>(BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT); } }(res); BTM_SecurityGrant(bd_addr, btm_status); } /******************************************************************************* Loading
system/bta/include/bta_sec_api.h +5 −7 Original line number Diff line number Diff line Loading @@ -24,16 +24,13 @@ #include <cstdint> #include "bta_api_data_types.h" #include "internal_include/bt_target.h" #include "bta/include/bta_api_data_types.h" #include "stack/include/bt_device_type.h" #include "stack/include/bt_name.h" #include "stack/include/bt_octets.h" #include "stack/include/btm_ble_sec_api_types.h" #include "stack/include/btm_sec_api_types.h" #include "stack/include/hci_error_code.h" #include "types/ble_address_with_type.h" #include "types/bt_transport.h" #include "types/raw_address.h" /* Security Setting Mask */ Loading Loading @@ -117,9 +114,10 @@ typedef struct { Octet16 dhk; } tBTA_BLE_LOCAL_ID_KEYS; #define BTA_DM_SEC_GRANTED BTA_SUCCESS #define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT typedef uint8_t tBTA_DM_BLE_SEC_GRANT; enum class tBTA_DM_BLE_SEC_GRANT { BTA_DM_SEC_GRANTED = BTA_SUCCESS, BTA_DM_SEC_PAIR_NOT_SPT = BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT }; /* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */ typedef struct { Loading
system/btif/src/btif_dm.cc +3 −3 Original line number Diff line number Diff line Loading @@ -2523,7 +2523,7 @@ void btif_dm_cancel_bond(const RawAddress bd_addr) { if (is_bonding_or_sdp()) { if (pairing_cb.is_ssp) { if (pairing_cb.is_le_only) { BTA_DmBleSecurityGrant(bd_addr, BTA_DM_SEC_PAIR_NOT_SPT); BTA_DmBleSecurityGrant(bd_addr, tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT); } else { BTA_DmConfirm(bd_addr, false); BTA_DmBondCancel(bd_addr); Loading Loading @@ -2645,9 +2645,9 @@ void btif_dm_ssp_reply(const RawAddress bd_addr, bt_ssp_variant_t variant, uint8 BTA_DmBleConfirmReply(bd_addr, accept); } else { if (accept) { BTA_DmBleSecurityGrant(bd_addr, BTA_DM_SEC_GRANTED); BTA_DmBleSecurityGrant(bd_addr, tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_GRANTED); } else { BTA_DmBleSecurityGrant(bd_addr, BTA_DM_SEC_PAIR_NOT_SPT); BTA_DmBleSecurityGrant(bd_addr, tBTA_DM_BLE_SEC_GRANT::BTA_DM_SEC_PAIR_NOT_SPT); } } } else { Loading