OSDN Git Service

btm_sec_are_all_trusted is never called
authorZach Johnson <zachoverflow@google.com>
Wed, 19 Aug 2020 23:16:16 +0000 (16:16 -0700)
committerZach Johnson <zachoverflow@google.com>
Thu, 20 Aug 2020 07:22:00 +0000 (00:22 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6dfd7e4e16091ac55a4b30a4eb4bf4783a0efba2

bta/dm/bta_dm_act.cc
stack/btm/btm_sec.cc
stack/btm/btm_sec.h
stack/include/btm_api_types.h

index 56f363b..67e62d3 100644 (file)
@@ -629,9 +629,6 @@ void bta_dm_remove_device(const RawAddress& bd_addr) {
 void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg) {
   uint8_t* p_dc = NULL;
   LinkKey* p_lc = NULL;
-  uint32_t trusted_services_mask[BTM_SEC_SERVICE_ARRAY_SIZE];
-
-  memset(trusted_services_mask, 0, sizeof(trusted_services_mask));
 
   /* If not all zeros, the device class has been specified */
   if (msg->dc_known) p_dc = (uint8_t*)msg->dc;
index aef84e9..08efeff 100644 (file)
@@ -4570,25 +4570,6 @@ static void btm_sec_start_encryption(tBTM_SEC_DEV_REC* p_dev_rec) {
 
 /*******************************************************************************
  *
- * Function         btm_sec_are_all_trusted
- *
- * Description      This function is called check if all services are trusted
- *
- * Returns          true if all are trusted, otherwise false
- *
- ******************************************************************************/
-bool btm_sec_are_all_trusted(uint32_t p_mask[]) {
-  uint32_t trusted_inx;
-  for (trusted_inx = 0; trusted_inx < BTM_SEC_SERVICE_ARRAY_SIZE;
-       trusted_inx++) {
-    if (p_mask[trusted_inx] != BTM_SEC_TRUST_ALL) return (false);
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
- *
  * Function         btm_sec_find_first_serv
  *
  * Description      Look for the first record in the service database
index 529b3b2..436fc7f 100644 (file)
@@ -32,7 +32,6 @@
  *             L O C A L    F U N C T I O N     P R O T O T Y P E S            *
  ******************************************************************************/
 tBTM_SEC_SERV_REC* btm_sec_find_first_serv(bool is_originator, uint16_t psm);
-bool btm_sec_are_all_trusted(uint32_t p_mask[]);
 
 tBTM_SEC_DEV_REC* btm_sec_find_dev_by_sec_state(uint8_t state);
 
index 54c7f60..72effea 100644 (file)
@@ -692,12 +692,6 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
 #define BTM_SEC_PROTO_HID 6 /* HID      */
 #define BTM_SEC_PROTO_AVDT 7
 
-/* Determine the number of uint32_t's necessary for security services */
-#define BTM_SEC_ARRAY_BITS 32 /* Number of bits in each array element */
-#define BTM_SEC_SERVICE_ARRAY_SIZE                         \
-  (((uint32_t)BTM_SEC_MAX_SERVICES / BTM_SEC_ARRAY_BITS) + \
-   (((uint32_t)BTM_SEC_MAX_SERVICES % BTM_SEC_ARRAY_BITS) ? 1 : 0))
-
 /* Security service definitions (BTM_SetSecurityLevel)
  * Used for Authorization APIs
 */
@@ -751,8 +745,6 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
  * trusted services
  ******************************************************************************/
 
-#define BTM_SEC_TRUST_ALL 0xFFFFFFFF /* for each array element */
-
 /****************************************
  *  Security Manager Callback Functions
  ****************************************/