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

Commit e320ec01 authored by Huirong Liao's avatar Huirong Liao
Browse files

Fix dual mode dev ble adv update config issue

[Root Cause]
when a dual mode device connected and ble scan is on going.
every ble adv will update config file and it will take more and more
 time to update config file, and many ble adv will buffer

[Solution]
don't update device property when cod/dev type no change.

Bug: 247905248
Test: dual mode device scan and connect successfully

Change-Id: I55433a9a693e6b942f683d5789b7829016a9f166
parent 2c8e59c3
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -150,9 +150,20 @@ void bta_scan_results_cb_impl(RawAddress bd_addr, tBT_DEVICE_TYPE device_type,
  }

  dev_type = (bt_device_type_t)device_type;

  uint32_t remote_dev_type = 0;
  BTIF_STORAGE_FILL_PROPERTY(&properties, BT_PROPERTY_TYPE_OF_DEVICE,
    sizeof(remote_dev_type), &remote_dev_type);
  dev_type = (btif_storage_get_remote_device_property(&bd_addr, &properties) == BT_STATUS_SUCCESS) ?
    (bt_device_type_t)(remote_dev_type | device_type) : (bt_device_type_t)device_type;

  if ((remote_dev_type != dev_type) && (dev_type != 0)) {
    BTIF_TRACE_DEBUG("%s dev_type change 0x%x=>0x%x, update config",
          __func__, remote_dev_type, dev_type);
    BTIF_STORAGE_FILL_PROPERTY(&properties, BT_PROPERTY_TYPE_OF_DEVICE,
                               sizeof(dev_type), &dev_type);
    btif_storage_set_remote_device_property(&(bd_addr), &properties);
  }

  btif_storage_set_remote_addr_type(&bd_addr, addr_type);
  HAL_CBACK(bt_gatt_callbacks, scanner->scan_result_cb, ble_evt_type, addr_type,
+1 −1
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ static void btif_update_remote_properties(const RawAddress& bdaddr,

  /* class of device */
  cod = devclass2uint(dev_class);
  if (cod == 0) {
  if ((cod == 0) || (cod == COD_UNCLASSIFIED)) {
    /* Try to retrieve cod from storage */
    LOG_VERBOSE("class of device (cod) is unclassified, checking storage");
    BTIF_STORAGE_FILL_PROPERTY(&properties[num_properties],