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

Commit cd489972 authored by Chao Quan's avatar Chao Quan Committed by Jakub Pawlowski
Browse files

Fix condition of adding device to resloving list

Initial conditions:
1. A phone with a bt controller which doesn't support LE
privacy feature.
2. A HOGP mouse which doesn't exchange identity informatin
(IRK & indentity address)to phone
Reproduce procedure:
1. phone pair with mouse.
2. Disconnect profile link to mouse.
3. re-initiate connect to mouse.
Result: Can't connect to mouse

After bond done, stack will try to add the bonded device
to resolving list. But in the condition that controller
doesn't support LE privacy, stack adds a record with a dummy
static address. When re-initiate connection to this device,
stack will use this dummy static address, and connection
fail.

Fix the related condition

Test: manual
Change-Id: I82621c57c54667294912d4270be10299e8029b4a
parent 3dc36374
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -699,8 +699,15 @@ bool btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
  }

  /* only add RPA enabled device into resolving list */
  if (controller_get_interface()->supports_ble_privacy()) {
    if ((p_dev_rec->ble.key_type & (BTM_LE_KEY_PID | BTM_LE_KEY_LID)) == 0) {
    BTM_TRACE_DEBUG("%s: Device not a RPA enabled device", __func__);
      BTM_TRACE_DEBUG("%s: privacy 1.2: Device not a RPA enabled device",
                      __func__);
      return false;
    }
  } else if ((p_dev_rec->ble.key_type & BTM_LE_KEY_PID) == 0) {
    BTM_TRACE_DEBUG("%s: RPA offloading: Device not a RPA enabled device",
                    __func__);
    return false;
  }