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

Commit 2374d062 authored by Chris Manton's avatar Chris Manton
Browse files

Check discoverability/connectability/inquirability return codes

Bug: 340680094
Test: m .
Flag: EXEMPT, Logging Change

Change-Id: I3e1e875a606b02d77accc4deb712ac4f002e40b8
parent 403edb5f
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -312,8 +312,12 @@ void bta_dm_disable() {
  /* disable all active subsystems */
  bta_sys_disable();

  BTM_SetDiscoverability(BTM_NON_DISCOVERABLE);
  BTM_SetConnectability(BTM_NON_CONNECTABLE);
  if (BTM_SetDiscoverability(BTM_NON_DISCOVERABLE) != BTM_SUCCESS) {
    log::warn("Unable to clear discoverability");
  }
  if (BTM_SetConnectability(BTM_NON_CONNECTABLE) != BTM_SUCCESS) {
    log::warn("Unable to clear connectability");
  }

  bta_dm_disable_pm();
  if (com::android::bluetooth::flags::separate_service_and_device_discovery()) {
@@ -436,8 +440,12 @@ bool BTA_DmSetVisibility(bt_scan_mode_t mode) {
      return false;
  }

  BTM_SetDiscoverability(disc_mode_param);
  BTM_SetConnectability(conn_mode_param);
  if (BTM_SetDiscoverability(disc_mode_param) != BTM_SUCCESS) {
    log::warn("Unable to set discoveability");
  }
  if (BTM_SetConnectability(conn_mode_param) != BTM_SUCCESS) {
    log::warn("Unable to set connectability");
  }
  return true;
}
void bta_dm_process_remove_device_no_callback(const RawAddress& bd_addr) {
@@ -1592,7 +1600,9 @@ void bta_dm_allow_wake_by_hid(
  // If there are any entries in the classic hid list, we should also make
  // the adapter connectable for classic.
  if (classic_hid_devices.size() > 0) {
    BTM_SetConnectability(BTA_DM_CONN);
    if (BTM_SetConnectability(BTA_DM_CONN) != BTM_SUCCESS) {
      log::warn("Unable to set connectability");
    }
  }

  bluetooth::shim::BTM_AllowWakeByHid(std::move(classic_hid_devices),
+9 −4
Original line number Diff line number Diff line
@@ -297,10 +297,15 @@ static void decode_controller_support() {
  btm_sec_dev_reset();

  if (bluetooth::shim::GetController()->SupportsRssiWithInquiryResults()) {
    if (bluetooth::shim::GetController()->SupportsExtendedInquiryResponse())
      BTM_SetInquiryMode(BTM_INQ_RESULT_EXTENDED);
    else
      BTM_SetInquiryMode(BTM_INQ_RESULT_WITH_RSSI);
    if (bluetooth::shim::GetController()->SupportsExtendedInquiryResponse()) {
      if (BTM_SetInquiryMode(BTM_INQ_RESULT_EXTENDED) != BTM_SUCCESS) {
        log::warn("Unable to set inquiry mode BTM_INQ_RESULT_EXTENDED");
      }
    } else {
      if (BTM_SetInquiryMode(BTM_INQ_RESULT_WITH_RSSI) != BTM_SUCCESS) {
        log::warn("Unable to set inquiry mode BTM_INQ_RESULT_WITH_RSSI");
      }
    }
  }

  l2cu_set_non_flushable_pbf(