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

Commit 5f8eb389 authored by Ugo Yu's avatar Ugo Yu Committed by Automerger Merge Worker
Browse files

Only report connectable devices when inquiry am: 34708f5d

parents 5e001a82 34708f5d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1861,6 +1861,8 @@ static void bta_dm_inq_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir,
  result.inq_res.p_eir = const_cast<uint8_t*>(p_eir);
  result.inq_res.eir_len = eir_len;

  result.inq_res.ble_evt_type = p_inq->ble_evt_type;

  p_inq_info = BTM_InqDbRead(p_inq->remote_bd_addr);
  if (p_inq_info != NULL) {
    /* initialize remt_name_not_required to false so that we get the name by
+11 −0
Original line number Diff line number Diff line
@@ -1381,6 +1381,17 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
        status = btif_storage_set_remote_addr_type(&bdaddr, addr_type);
        ASSERTC(status == BT_STATUS_SUCCESS,
                "failed to save remote addr type (inquiry)", status);

        bool restrict_report = osi_property_get_bool(
            "bluetooth.restrict_discovered_device.enabled", false);
        if (restrict_report &&
            p_search_data->inq_res.device_type == BT_DEVICE_TYPE_BLE &&
            !(p_search_data->inq_res.ble_evt_type & BTM_BLE_CONNECTABLE_MASK)) {
          LOG_INFO("%s: Ble device is not connectable",
                   bdaddr.ToString().c_str());
          break;
        }

        /* Callback to notify upper layer of device */
        invoke_device_found_cb(num_properties, properties);
      }