OSDN Git Service

Introduce BTM_SetRfcommSecurity
authorHansong Zhang <hsz@google.com>
Sun, 30 Aug 2020 22:29:39 +0000 (15:29 -0700)
committerHansong Zhang <hsz@google.com>
Mon, 31 Aug 2020 18:59:26 +0000 (11:59 -0700)
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

index 329af11..526c98a 100644 (file)
@@ -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