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

Commit 2f2b7a78 authored by Hui Peng's avatar Hui Peng
Browse files

Mark the bond type of loaded devices as persistent

Bug: 319531443
Bug: 319530790
Test: m .
Change-Id: Idd77ecc3f8f5860c9a14f64932f5ceff603747a5
parent 8737a3d6
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