From 405ba88ac6325f52013151cc026a2177dbc15a30 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Sun, 30 Aug 2020 15:29:39 -0700 Subject: [PATCH] Introduce BTM_SetRfcommSecurity Store RFCOMM security requirements in a separate map Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I6e1737e54506e8744f350c6ba6f75b47c77ea885 --- stack/btm/btm_sec.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stack/btm/btm_sec.cc b/stack/btm/btm_sec.cc index 329af1190..526c98a91 100644 --- a/stack/btm/btm_sec.cc +++ b/stack/btm/btm_sec.cc @@ -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 + 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 -- 2.11.0