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

Commit 8082ff8c authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7311204 from 3e775499 to sc-release

Change-Id: Ic3c6b63c2ea55b6c6d43cbeb014154d7f647f277
parents b3c4d6a4 3e775499
Loading
Loading
Loading
Loading
+19 −12
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ static void btif_dm_ble_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type);
static void btif_dm_ble_sc_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type);

static void bte_scan_filt_param_cfg_evt(uint8_t action_type, uint8_t avbl_space,
                                        uint8_t ref_value, uint8_t status);
                                        uint8_t ref_value, uint8_t btm_status);

static char* btif_get_default_local_name();

@@ -1213,8 +1213,11 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
    } break;

    case BTA_DM_INQ_CMPL_EVT: {
      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,
                                 static_cast<tBTM_BLE_PF_FILT_INDEX>(0),
                                 nullptr,
                                 base::Bind(&bte_scan_filt_param_cfg_evt,
                                            btm_status_value(BTM_SUCCESS)));
    } break;
    case BTA_DM_DISC_CMPL_EVT: {
      invoke_discovery_state_changed_cb(BT_DISCOVERY_STOPPED);
@@ -1233,7 +1236,8 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
        btgatt_filt_param_setup_t adv_filt_param;
        memset(&adv_filt_param, 0, sizeof(btgatt_filt_param_setup_t));
        BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr,
                                   base::Bind(&bte_scan_filt_param_cfg_evt, 0));
                                   base::Bind(&bte_scan_filt_param_cfg_evt,
                                              btm_status_value(BTM_SUCCESS)));
        invoke_discovery_state_changed_cb(BT_DISCOVERY_STOPPED);
      }
    } break;
@@ -1780,12 +1784,13 @@ static void bta_energy_info_cb(tBTM_BLE_TX_TIME_MS tx_time,

/* Scan filter param config event */
static void bte_scan_filt_param_cfg_evt(uint8_t ref_value, uint8_t avbl_space,
                                        uint8_t action_type, uint8_t status) {
                                        uint8_t action_type,
                                        uint8_t btm_status) {
  /* This event occurs on calling BTA_DmBleCfgFilterCondition internally,
  ** and that is why there is no HAL callback
  */
  if (BTA_SUCCESS != status) {
    BTIF_TRACE_ERROR("%s, %d", __func__, status);
  if (btm_status != btm_status_value(BTM_SUCCESS)) {
    BTIF_TRACE_ERROR("%s, %d", __func__, btm_status);
  } else {
    BTIF_TRACE_DEBUG("%s", __func__);
  }
@@ -1808,8 +1813,9 @@ void btif_dm_start_discovery(void) {
  BTIF_TRACE_EVENT("%s", __func__);

  /* Cleanup anything remaining on index 0 */
  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, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), nullptr,
      base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS)));

  auto adv_filt_param = std::make_unique<btgatt_filt_param_setup_t>();
  /* Add an allow-all filter on index 0*/
@@ -1819,9 +1825,10 @@ 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;
  BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_ADD, 0,
  BTM_BleAdvFilterParamSetup(
      BTM_BLE_SCAN_COND_ADD, static_cast<tBTM_BLE_PF_FILT_INDEX>(0),
      std::move(adv_filt_param),
                             base::Bind(&bte_scan_filt_param_cfg_evt, 0));
      base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS)));

  /* Will be enabled to true once inquiry busy level has been received */
  btif_dm_inquiry_in_progress = false;
+10 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ struct Controller::impl {
    // SSP is managed by security layer once enabled
    if (!common::init_flags::gd_security_is_enabled()) {
      write_simple_pairing_mode(Enable::ENABLED);
      hci_->EnqueueCommand(
          WriteSecureConnectionsHostSupportBuilder::Create(Enable::ENABLED),
          handler->BindOnceOn(this, &Controller::impl::write_secure_connections_host_support_complete_handler));
    }
    hci_->EnqueueCommand(ReadLocalNameBuilder::Create(),
                         handler->BindOnceOn(this, &Controller::impl::read_local_name_complete_handler));
@@ -189,6 +192,13 @@ struct Controller::impl {
    acl_monitor_credits_callback_ = {};
  }

  void write_secure_connections_host_support_complete_handler(CommandCompleteView view) {
    auto complete_view = WriteSecureConnectionsHostSupportCompleteView::Create(view);
    ASSERT(complete_view.IsValid());
    ErrorCode status = complete_view.GetStatus();
    ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
  }

  void read_local_name_complete_handler(CommandCompleteView view) {
    auto complete_view = ReadLocalNameCompleteView::Create(view);
    ASSERT(complete_view.IsValid());
+1 −1
Original line number Diff line number Diff line
@@ -548,7 +548,7 @@ tBTM_STATUS bluetooth::shim::BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
  uint8_t classic_mode = inqparms.mode & 0x0f;
  if (!Stack::GetInstance()->GetBtm()->StartInquiry(
          classic_mode, inqparms.duration, 0,
          [](uint16_t status, uint8_t inquiry_mode) {
          [](tBTM_STATUS status, uint8_t inquiry_mode) {
            LOG_INFO("%s Inquiry is complete status:%hd inquiry_mode:%hhd",
                     __func__, status, inquiry_mode);
            btm_cb.btm_inq_vars.inqparms.mode &= ~(inquiry_mode);
+7 −4
Original line number Diff line number Diff line
@@ -117,7 +117,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface,
    bluetooth::shim::GetScanning()->ScanFilterParameterSetup(
        apcf_action, filter_index, advertising_filter_parameter);
    // TODO refactor callback mechanism
    do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0));
    do_in_jni_thread(FROM_HERE,
                     base::Bind(cb, 0, 0, btm_status_value(BTM_SUCCESS)));
  }

  /** Configure a scan filter condition  */
@@ -135,7 +136,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface,
      new_filters.push_back(command);
    }
    bluetooth::shim::GetScanning()->ScanFilterAdd(filter_index, new_filters);
    do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0, 0));
    do_in_jni_thread(FROM_HERE,
                     base::Bind(cb, 0, 0, 0, btm_status_value(BTM_SUCCESS)));
  }

  /** Clear all scan filter conditions for specific filter index*/
@@ -150,7 +152,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface,
    bluetooth::shim::GetScanning()->ScanFilterEnable(enable);

    uint8_t action = enable ? 1 : 0;
    do_in_jni_thread(FROM_HERE, base::Bind(cb, action, 0));
    do_in_jni_thread(FROM_HERE,
                     base::Bind(cb, action, btm_status_value(BTM_SUCCESS)));
  }

  /** Sets the LE scan interval and window in units of N*0.625 msec */
+0 −3
Original line number Diff line number Diff line
@@ -298,9 +298,6 @@ void acl_write_automatic_flush_timeout(const RawAddress& bd_addr,
                                       uint16_t flush_timeout_in_ticks) {
  mock_function_count_map[__func__]++;
}
void btm_acl_chk_peer_pkt_type_support(tACL_CONN* p, uint16_t* p_pkt_type) {
  mock_function_count_map[__func__]++;
}
void btm_acl_connected(const RawAddress& bda, uint16_t handle,
                       tHCI_STATUS status, uint8_t enc_mode) {
  mock_function_count_map[__func__]++;
Loading