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

Commit 90831f61 authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Const-ify BTM_SecAddDevice

Bug: 187830698
Tag: #refactor
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Id3fed41789d9a98a9c7c9b814ca8c1a5cab1e44c
parent 6bf2e507
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,8 @@ tBTM_STATUS bluetooth::shim::BTM_SecBondCancel(const RawAddress& bd_addr) {
}

bool bluetooth::shim::BTM_SecAddDevice(const RawAddress& bd_addr,
                                       DEV_CLASS dev_class, BD_NAME bd_name,
                                       DEV_CLASS dev_class,
                                       const BD_NAME& bd_name,
                                       uint8_t* features, LinkKey* link_key,
                                       uint8_t key_type, uint8_t pin_length) {
  // Check if GD has a security record for the device
+2 −2
Original line number Diff line number Diff line
@@ -1403,8 +1403,8 @@ uint8_t BTM_SecClrService(uint8_t service_id);
 *
 ******************************************************************************/
bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
                      BD_NAME bd_name, uint8_t* features, LinkKey* link_key,
                      uint8_t key_type, uint8_t pin_length);
                      const BD_NAME& bd_name, uint8_t* features,
                      LinkKey* link_key, uint8_t key_type, uint8_t pin_length);

/** Free resources associated with the device associated with |bd_addr| address.
 *
+3 −2
Original line number Diff line number Diff line
@@ -62,8 +62,9 @@ extern tBTM_CB btm_cb;
 *
 ******************************************************************************/
bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
                      BD_NAME bd_name, uint8_t* features, LinkKey* p_link_key,
                      uint8_t key_type, uint8_t pin_length) {
                      const BD_NAME& bd_name, uint8_t* features,
                      LinkKey* p_link_key, uint8_t key_type,
                      uint8_t pin_length) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);
  if (!p_dev_rec) {
    p_dev_rec = btm_sec_allocate_dev_rec();
+0 −21
Original line number Diff line number Diff line
@@ -21,27 +21,6 @@
#include "stack/include/bt_octets.h"
#include "types/raw_address.h"

/*******************************************************************************
 *
 * Function         BTM_SecAddDevice
 *
 * Description      Add/modify device.  This function will be normally called
 *                  during host startup to restore all required information
 *                  stored in the NVRAM.
 *
 * Parameters:      bd_addr          - BD address of the peer
 *                  dev_class        - Device Class
 *                  bd_name          - Name of the peer device. NULL if unknown.
 *                  features         - Remote device's features (up to 3 pages).
 *                                     NULL if not known
 *                  link_key         - Connection link key. NULL if unknown.
 *
 * Returns          true if added OK, else false
 *
 ******************************************************************************/
bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
                      BD_NAME bd_name, uint8_t* features, LinkKey* p_link_key,
                      uint8_t key_type, uint8_t pin_length);
void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec);

/** Free resources associated with the device associated with |bd_addr| address.
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ struct tBTM_SEC_DEV_REC {

 private:
  friend bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
                               BD_NAME bd_name, uint8_t* features,
                               const BD_NAME& bd_name, uint8_t* features,
                               LinkKey* p_link_key, uint8_t key_type,
                               uint8_t pin_length);
  friend void BTM_PINCodeReply(const RawAddress& bd_addr, tBTM_STATUS res,
Loading