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

Commit 16309c4a authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Automerger Merge Worker
Browse files

Merge "Allow LE encryption while BR/EDR encryption is going on" into main am: ffe9dcdd

parents 4a22f865 ffe9dcdd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,3 +24,11 @@ prop {
    access: Readonly
    prop_name: "bluetooth.ble.random_address_rotation_interval_max"
}

prop {
    api_name: "allow_enc_with_bredr"
    type: Boolean
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.ble.allow_enc_with_bredr"
}
+11 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include "stack/btm/btm_ble_sec.h"

#include <android_bluetooth_sysprop.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>

@@ -1234,8 +1235,16 @@ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk,
    return BTM_WRONG_MODE;
  }

  if (p_rec->sec_rec.is_security_state_encrypting()) {
    log::warn("Link Encryption is active, Busy!");
  if (p_rec->sec_rec.is_security_state_le_encrypting()) {
    log::warn("LE link encryption is active, Busy!");
    return BTM_BUSY;
  }

  // Some controllers may not like encrypting both transports at the same time
  bool allow_le_enc_with_bredr = GET_SYSPROP(Ble, allow_enc_with_bredr, false);
  if (!allow_le_enc_with_bredr &&
      p_rec->sec_rec.is_security_state_bredr_encrypting()) {
    log::warn("BR/EDR link encryption is active, Busy!");
    return BTM_BUSY;
  }