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

Commit 1fe2f026 authored by Chienyuan Huang's avatar Chienyuan Huang
Browse files

RAS: Ignore duplicate BTA_GATTC_SEARCH_CMPL_EVT

Bug: 324185011
Bug: 352215898
Test: m com.android.btservices
Change-Id: I96619151833a3e4e18f22b97a1a047aebdc6c38e
parent cd70bb74
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public:
    uint16_t latest_ranging_counter_ = 0;
    bool handling_on_demand_data_ = false;
    bool is_connected_ = false;
    bool service_search_complete_ = false;
    std::vector<VendorSpecificCharacteristic> vendor_specific_characteristics_;
    uint8_t writeReplyCounter_ = 0;
    uint8_t writeReplySuccessCounter_ = 0;
@@ -226,11 +227,15 @@ public:
      }
    }

    if (!service_found) {
    if (tracker->service_search_complete_) {
      log::info("Service search already completed, ignore");
      return;
    } else if (!service_found) {
      log::error("Can't find Ranging Service in the services list");
      return;
    } else {
      log::info("Found Ranging Service");
      tracker->service_search_complete_ = true;
      ListCharacteristic(tracker);
    }

@@ -500,6 +505,7 @@ public:
  }

  void ListCharacteristic(std::shared_ptr<RasTracker> tracker) {
    tracker->vendor_specific_characteristics_.clear();
    for (auto& characteristic : tracker->service_->characteristics) {
      bool vendor_specific = !IsRangingServiceCharacteristic(characteristic.uuid);
      log::info(