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

Commit 40d9807e authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove unused parameters from bta_dm_authorize_cback

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic94ed2183ba2828158d68d57bdfbd5c80df6905e
parent 9bf41e7f
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -69,10 +69,7 @@ static void bta_dm_remname_cback(void* p);
static void bta_dm_find_services(const RawAddress& bd_addr);
static void bta_dm_discover_next_device(void);
static void bta_dm_sdp_callback(uint16_t sdp_status);
static uint8_t bta_dm_authorize_cback(const RawAddress& bd_addr,
                                      DEV_CLASS dev_class, BD_NAME bd_name,
                                      uint8_t* service_name, uint8_t service_id,
                                      bool is_originator);
static uint8_t bta_dm_authorize_cback(uint8_t service_id);
static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class,
                                BD_NAME bd_name, bool min_16_digit);
static uint8_t bta_dm_new_link_key_cback(const RawAddress& bd_addr,
@@ -2216,11 +2213,7 @@ static void bta_dm_remname_cback(void* p) {
 * Returns          void
 *
 ******************************************************************************/
static uint8_t bta_dm_authorize_cback(const RawAddress& bd_addr,
                                      DEV_CLASS dev_class, BD_NAME bd_name,
                                      UNUSED_ATTR uint8_t* service_name,
                                      uint8_t service_id,
                                      UNUSED_ATTR bool is_originator) {
static uint8_t bta_dm_authorize_cback(uint8_t service_id) {
  uint8_t index = 1;
  while (index < BTA_MAX_SERVICE_ID) {
    /* get the BTA service id corresponding to BTM id */
+3 −14
Original line number Diff line number Diff line
@@ -4910,32 +4910,21 @@ static void btm_sec_start_encryption(tBTM_SEC_DEV_REC* p_dev_rec) {
 ******************************************************************************/
static uint8_t btm_sec_start_authorization(tBTM_SEC_DEV_REC* p_dev_rec) {
  uint8_t result;
  uint8_t* p_service_name = NULL;
  uint8_t service_id;

  if ((p_dev_rec->sec_flags & BTM_SEC_NAME_KNOWN) ||
      (p_dev_rec->hci_handle == BTM_SEC_INVALID_HANDLE)) {
    if (!btm_cb.api.p_authorize_callback) return (BTM_MODE_UNSUPPORTED);

    if (p_dev_rec->p_cur_service) {
#if BTM_SEC_SERVICE_NAME_LEN > 0
      if (p_dev_rec->is_originator)
        p_service_name = p_dev_rec->p_cur_service->orig_service_name;
      else
        p_service_name = p_dev_rec->p_cur_service->term_service_name;
#endif
      service_id = p_dev_rec->p_cur_service->service_id;
    } else
      service_id = 0;
    service_id =
        p_dev_rec->p_cur_service ? p_dev_rec->p_cur_service->service_id : 0;

    /* Send authorization request if not already sent during this service
     * connection */
    if (p_dev_rec->last_author_service_id == BTM_SEC_NO_LAST_SERVICE_ID ||
        p_dev_rec->last_author_service_id != service_id) {
      p_dev_rec->sec_state = BTM_SEC_STATE_AUTHORIZING;
      result = (*btm_cb.api.p_authorize_callback)(
          p_dev_rec->bd_addr, p_dev_rec->dev_class, p_dev_rec->sec_bd_name,
          p_service_name, service_id, p_dev_rec->is_originator);
      result = (*btm_cb.api.p_authorize_callback)(service_id);
    }

    else /* Already authorized once for this L2CAP bringup */
+1 −9
Original line number Diff line number Diff line
@@ -821,18 +821,10 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
 *  Security Manager Callback Functions
 ****************************************/
/* Authorize device for service.  Parameters are
 *              BD Address of remote
 *              Device Class of remote
 *              BD Name of remote
 *              Service name
 *              Service Id (NULL - unknown service or unused
 *                                 [BTM_SEC_SERVICE_NAME_LEN set to 0])
 *              Is originator of the connection
 *              Result of the operation
*/
typedef uint8_t(tBTM_AUTHORIZE_CALLBACK)(
    const RawAddress& bd_addr, DEV_CLASS dev_class, tBTM_BD_NAME bd_name,
    uint8_t* service_name, uint8_t service_id, bool is_originator);
typedef uint8_t(tBTM_AUTHORIZE_CALLBACK)(uint8_t service_id);

/* Get PIN for the connection.  Parameters are
 *              BD Address of remote