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

Commit c05641f0 authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "[Invisalign2] Add transport to BTM_ConfirmReqReply" into main am: 681c8c31 am: 72fb0b1f

parents b16fbcbe 72fb0b1f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "stack/include/btm_sec_api.h"
#include "stack/include/gatt_api.h"
#include "stack/include/security_client_callbacks.h"
#include "types/bt_transport.h"
#include "types/raw_address.h"

static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data);
@@ -218,8 +219,8 @@ void bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg) {

/** Send the user confirm request reply in response to a request from BTM */
void bta_dm_confirm(const RawAddress& bd_addr, bool accept) {
  get_btm_client_interface().security.BTM_ConfirmReqReply(
      accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED, bd_addr);
  get_btm_client_interface().security.BTM_SecConfirmReqReply(
      accept ? BTM_SUCCESS : BTM_NOT_AUTHORIZED, BT_TRANSPORT_BR_EDR, bd_addr);
}

/** respond to the OOB data request for the remote device from BTM */
+14 −1
Original line number Diff line number Diff line
@@ -15,12 +15,25 @@
 *
 */

#define LOG_TAG "sec_interf"

#include "os/log.h"
#include "stack/btm/btm_dev.h"
#include "stack/btm/btm_sec.h"
#include "stack/btm/btm_sec_cb.h"
#include "stack/include/btm_ble_sec_api.h"
#include "stack/include/btm_sec_api.h"
#include "stack/include/security_client_callbacks.h"
#include "types/bt_transport.h"

static void BTM_SecConfirmReqReply(tBTM_STATUS res, tBT_TRANSPORT transport,
                                   const RawAddress bd_addr) {
  if (transport == BT_TRANSPORT_BR_EDR) {
    BTM_ConfirmReqReply(res, bd_addr);
  } else {
    LOG_ERROR("Unexpected transport:%d", transport);
  }
}

static SecurityClientInterface security = {
    .BTM_Sec_Init = BTM_Sec_Init,
@@ -39,7 +52,7 @@ static SecurityClientInterface security = {
    .BTM_SecClrServiceByPsm = BTM_SecClrServiceByPsm,
    .BTM_RemoteOobDataReply = BTM_RemoteOobDataReply,
    .BTM_PINCodeReply = BTM_PINCodeReply,
    .BTM_ConfirmReqReply = BTM_ConfirmReqReply,
    .BTM_SecConfirmReqReply = BTM_SecConfirmReqReply,
    .BTM_SecDeleteRmtNameNotifyCallback = BTM_SecDeleteRmtNameNotifyCallback,
    .BTM_SetEncryption = BTM_SetEncryption,
    .BTM_IsEncrypted = BTM_IsEncrypted,
+3 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "stack/include/bt_octets.h"
#include "stack/include/btm_ble_sec_api_types.h"
#include "stack/include/hci_error_code.h"
#include "types/bt_transport.h"
#include "types/raw_address.h"

/****************************************
@@ -119,7 +120,8 @@ typedef struct {
                                 const Octet16& c, const Octet16& r);
  void (*BTM_PINCodeReply)(const RawAddress& bd_addr, tBTM_STATUS res,
                           uint8_t pin_len, uint8_t* p_pin);
  void (*BTM_ConfirmReqReply)(tBTM_STATUS res, const RawAddress& bd_addr);
  void (*BTM_SecConfirmReqReply)(tBTM_STATUS res, tBT_TRANSPORT transport,
                                 const RawAddress bd_addr);
  bool (*BTM_SecDeleteRmtNameNotifyCallback)(
      tBTM_RMT_NAME_CALLBACK* p_callback);
  tBTM_STATUS (*BTM_SetEncryption)(const RawAddress& bd_addr,
+4 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "stack/include/btm_client_interface.h"
#include "stack/include/btm_sec_api.h"
#include "stack/include/btm_sec_api_types.h"
#include "types/bt_transport.h"
#include "types/raw_address.h"

// Test accessible feature page
@@ -151,8 +152,9 @@ struct btm_client_interface_t default_btm_client_interface = {
        .BTM_PINCodeReply = [](const RawAddress& /* bd_addr */,
                               tBTM_STATUS /* res */, uint8_t /* pin_len */,
                               uint8_t* /* p_pin */) {},
        .BTM_ConfirmReqReply = [](tBTM_STATUS /* res */,
                                  const RawAddress& /* bd_addr */) {},
        .BTM_SecConfirmReqReply = [](tBTM_STATUS /* res */,
                                     tBT_TRANSPORT /* transport */,
                                     const RawAddress /* bd_addr */) {},
        .BTM_SecDeleteRmtNameNotifyCallback =
            [](tBTM_RMT_NAME_CALLBACK* /* p_callback */) -> bool {
          return false;