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

Commit 6e6c5a69 authored by Zach Johnson's avatar Zach Johnson
Browse files

btif_dm_start_discovery is running on the main thread

no need to post to the main thread

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I2df0bfd2874581123064947c5b9401e98d1f9955
parent 4911e2a0
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -1984,10 +1984,8 @@ void btif_dm_start_discovery(void) {
  BTIF_TRACE_EVENT("%s", __func__);

  /* Cleanup anything remaining on index 0 */
  do_in_main_thread(
      FROM_HERE,
      base::Bind(&BTM_BleAdvFilterParamSetup, BTM_BLE_SCAN_COND_DELETE, 0,
                 nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)));
  BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr,
                             base::Bind(&bte_scan_filt_param_cfg_evt, 0));

  auto adv_filt_param = std::make_unique<btgatt_filt_param_setup_t>();
  /* Add an allow-all filter on index 0*/
@@ -1997,10 +1995,9 @@ void btif_dm_start_discovery(void) {
  adv_filt_param->list_logic_type = BTA_DM_BLE_PF_LIST_LOGIC_OR;
  adv_filt_param->rssi_low_thres = LOWEST_RSSI_VALUE;
  adv_filt_param->rssi_high_thres = LOWEST_RSSI_VALUE;
  do_in_main_thread(
      FROM_HERE, base::Bind(&BTM_BleAdvFilterParamSetup, BTM_BLE_SCAN_COND_ADD,
                            0, base::Passed(&adv_filt_param),
                            base::Bind(&bte_scan_filt_param_cfg_evt, 0)));
  BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_ADD, 0,
                             std::move(adv_filt_param),
                             base::Bind(&bte_scan_filt_param_cfg_evt, 0));

  /* TODO: Do we need to handle multiple inquiries at the same time? */