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

Commit a8ef49f0 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Automerger Merge Worker
Browse files

BTA_DM_DISC_BLE_RES_EVT -> BTA_DM_GATT_OVER_LE_RES_EVT and...

BTA_DM_DISC_BLE_RES_EVT -> BTA_DM_GATT_OVER_LE_RES_EVT and BTA_DM_GATT_OVER_SDP_RES_EVT am: d31146f1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/20551697



Change-Id: I0b607efd72ae76d41cab2665d36c7542a3c199fc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 385b27f9 d31146f1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1143,7 +1143,8 @@ void bta_dm_sdp_result(tBTA_DM_MSG* p_data) {
                  BD_NAME_LEN + 1);

          result.disc_ble_res.services = &gatt_uuids;
          bta_dm_search_cb.p_search_cback(BTA_DM_DISC_BLE_RES_EVT, &result);
          bta_dm_search_cb.p_search_cback(BTA_DM_GATT_OVER_SDP_RES_EVT,
                                          &result);
        }
      } else {
        /* SDP_DB_FULL means some records with the
@@ -1336,7 +1337,7 @@ void bta_dm_search_cmpl() {

  LOG_INFO("GATT services discovered using LE Transport");
  // send all result back to app
  bta_dm_search_cb.p_search_cback(BTA_DM_DISC_BLE_RES_EVT, &result);
  bta_dm_search_cb.p_search_cback(BTA_DM_GATT_OVER_LE_RES_EVT, &result);

  bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr);

+4 −2
Original line number Diff line number Diff line
@@ -419,10 +419,12 @@ typedef void(tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data);
#define BTA_DM_INQ_RES_EVT 0  /* Inquiry result for a peer device. */
#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
#define BTA_DM_DISC_BLE_RES_EVT \
  3 /* Discovery result for BLE GATT based servoce on a peer device. */
#define BTA_DM_GATT_OVER_LE_RES_EVT \
  3 /* GATT services over LE transport discovered */
#define BTA_DM_DISC_CMPL_EVT 4          /* Discovery complete. */
#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
#define BTA_DM_DID_RES_EVT 7            /* Vendor/Product ID search result */
#define BTA_DM_GATT_OVER_SDP_RES_EVT 8  /* GATT services over SDP discovered */

typedef uint8_t tBTA_DM_SEARCH_EVT;

+9 −3
Original line number Diff line number Diff line
@@ -1530,14 +1530,20 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
      /* no-op */
      break;

    case BTA_DM_DISC_BLE_RES_EVT: {
    case BTA_DM_GATT_OVER_SDP_RES_EVT:
    case BTA_DM_GATT_OVER_LE_RES_EVT: {
      int num_properties = 0;
      bt_property_t prop[2];
      std::vector<uint8_t> property_value;
      std::set<Uuid> uuids;
      RawAddress& bd_addr = p_data->disc_ble_res.bd_addr;

      LOG_INFO("New BLE UUIDs for %s:", bd_addr.ToString().c_str());
      if (event == BTA_DM_GATT_OVER_LE_RES_EVT) {
        LOG_INFO("New GATT over LE UUIDs for %s:", bd_addr.ToString().c_str());
      } else {
        LOG_INFO("New GATT over SDP UUIDs for %s:", bd_addr.ToString().c_str());
      }

      for (Uuid uuid : *p_data->disc_ble_res.services) {
        if (btif_is_interesting_le_service(uuid)) {
          if (btif_should_ignore_uuid(uuid)) {
@@ -1550,7 +1556,7 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
      }

      if (uuids.empty()) {
        LOG_INFO("No well known BLE services discovered");
        LOG_INFO("No well known GATT services discovered");
        return;
      }

+2 −1
Original line number Diff line number Diff line
@@ -112,9 +112,10 @@ const char* dump_dm_search_event(uint16_t event) {
    CASE_RETURN_STR(BTA_DM_INQ_RES_EVT)
    CASE_RETURN_STR(BTA_DM_INQ_CMPL_EVT)
    CASE_RETURN_STR(BTA_DM_DISC_RES_EVT)
    CASE_RETURN_STR(BTA_DM_DISC_BLE_RES_EVT)
    CASE_RETURN_STR(BTA_DM_GATT_OVER_LE_RES_EVT)
    CASE_RETURN_STR(BTA_DM_DISC_CMPL_EVT)
    CASE_RETURN_STR(BTA_DM_SEARCH_CANCEL_CMPL_EVT)
    CASE_RETURN_STR(BTA_DM_GATT_OVER_SDP_RES_EVT)

    default:
      return "UNKNOWN MSG ID";
+4 −1
Original line number Diff line number Diff line
@@ -225,10 +225,13 @@ TEST_F(BtifCoreTest, dump_dm_search_event) {
      std::make_pair(BTA_DM_INQ_RES_EVT, "BTA_DM_INQ_RES_EVT"),
      std::make_pair(BTA_DM_INQ_CMPL_EVT, "BTA_DM_INQ_CMPL_EVT"),
      std::make_pair(BTA_DM_DISC_RES_EVT, "BTA_DM_DISC_RES_EVT"),
      std::make_pair(BTA_DM_DISC_BLE_RES_EVT, "BTA_DM_DISC_BLE_RES_EVT"),
      std::make_pair(BTA_DM_GATT_OVER_LE_RES_EVT,
                     "BTA_DM_GATT_OVER_LE_RES_EVT"),
      std::make_pair(BTA_DM_DISC_CMPL_EVT, "BTA_DM_DISC_CMPL_EVT"),
      std::make_pair(BTA_DM_SEARCH_CANCEL_CMPL_EVT,
                     "BTA_DM_SEARCH_CANCEL_CMPL_EVT"),
      std::make_pair(BTA_DM_GATT_OVER_SDP_RES_EVT,
                     "BTA_DM_GATT_OVER_SDP_RES_EVT"),
  };
  for (const auto& event : events) {
    ASSERT_STREQ(event.second.c_str(), dump_dm_search_event(event.first));