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

Commit 4187100c authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "Mark the bond type of loaded devices as persistent" into main am: cae7c96d

parents 73c0c4b4 cae7c96d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

#include <string>

#include "android_bluetooth_flags.h"
#include "btm_api.h"
#include "btm_int_types.h"
#include "btm_sec_api.h"
@@ -134,6 +135,10 @@ bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
    p_dev_rec->sec_rec.link_key_type = key_type;
    p_dev_rec->sec_rec.pin_code_length = pin_length;

    if (IS_FLAG_ENABLED(correct_bond_type_of_loaded_devices)) {
      p_dev_rec->sec_rec.bond_type = BOND_TYPE_PERSISTENT;
    }

    if (pin_length >= 16 || key_type == BTM_LKEY_TYPE_AUTH_COMB ||
        key_type == BTM_LKEY_TYPE_AUTH_COMB_P_256) {
      // Set the flag if the link key was made by using either a 16 digit