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

Commit 34708f5d authored by Ugo Yu's avatar Ugo Yu Committed by William Escande
Browse files

Only report connectable devices when inquiry

Drop all non-connectable BLE beacons to reduce the spam in the
settings' scanning page.

Bug: 219387005
Bug: 263323082
Test: manual
(cherry picked from commit 1f7ef99de59406a1a2fc0ce14631df64249b35e2)
(cherry picked from commit 39c46789)
Merged-In: I6193498b06253256e39bd26dfc3db15fd01e28b9
Change-Id: I73496789bf20491c5c4b3ebb69e8d1dbe7416775
parent ca7e278e
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);
      }