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

Commit 281d294d authored by Mehmet Murat Sevim's avatar Mehmet Murat Sevim Committed by Cherrypicker Worker
Browse files

Disable btif_gatt_check_encrypted_link.

It seems to cause redundant Security Requests that lead to pairing
prompts and bond loss on iOS paired watches. Removing this code
fixes the issue by partially bringing back the behavior used when
BLE_DELAY_REQUEST_ENC flag was enabled.

Test: manual - verified salmon paired with iOS 14.2 does not lose bond
Test:        - or trigger pairing alerts anymore.
Bug: 175785899
Bug: 263323082
Tag: #stability
Change-Id: I5fb3eca8419e79c72d067f3f38e1f952de266646
(cherry picked from commit 7c2fe92921e9b3d81d417bd33c079740270cbbe2)
(cherry picked from commit 1514f4b9)
Merged-In: I5fb3eca8419e79c72d067f3f38e1f952de266646
parent 03077e74
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "btif_gatt.h"
#include "btif_storage.h"
#include "btif_util.h"
#include "gd/os/system_properties.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"
#include "stack/btm/btm_sec.h"
@@ -75,6 +76,12 @@ static void btif_gatt_set_encryption_cb(UNUSED_ATTR const RawAddress& bd_addr,

void btif_gatt_check_encrypted_link(RawAddress bd_addr,
                                    tBT_TRANSPORT transport_link) {
  static const bool check_encrypted = bluetooth::os::GetSystemPropertyBool(
      "bluetooth.gatt.check_encrypted_link.enabled", true);
  if (!check_encrypted) {
    LOG_DEBUG("Check skipped due to system config");
    return;
  }
  tBTM_LE_PENC_KEYS key;
  if ((btif_storage_get_ble_bonding_key(
           bd_addr, BTM_LE_KEY_PENC, (uint8_t*)&key,