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

Commit a2d7e42f authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Introduce BTM_SetRfcommSecurity

Store RFCOMM security requirements in a separate map

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6e1737e54506e8744f350c6ba6f75b47c77ea885
parent 12d183ff
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -506,6 +506,20 @@ bool BTM_SetSecurityLevel(bool is_originator, const char* p_name,
  return (record_allocated);
}

struct RfcommSecurityRecord {
  uint32_t scn;
  bool need_mitm;
  bool need_16_digit_pin;
};
static std::unordered_map<uint32_t, RfcommSecurityRecord>
    legacy_stack_rfcomm_security_records;

void BTM_SetRfcommSecurity(uint32_t scn, bool need_mitm,
                           bool need_16_digit_pin) {
  legacy_stack_rfcomm_security_records[scn] = {scn, need_mitm,
                                               need_16_digit_pin};
}

/*******************************************************************************
 *
 * Function         BTM_SecClrService