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

Commit b10c6ece authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Clear static btm checks during shutdown"

parents 33485d02 82642fee
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <mutex>

#include "main/shim/btm.h"
#include "main/shim/controller.h"
@@ -71,6 +72,7 @@ extern void btm_api_process_extended_inquiry_result(

void bluetooth::shim::Btm::StartUp(bluetooth::shim::Btm* btm) {
  CHECK(btm != nullptr);
  std::unique_lock<std::mutex> lock(btm->sync_mutex_);
  CHECK(btm->observing_timer_ == nullptr);
  CHECK(btm->scanning_timer_ == nullptr);
  btm->observing_timer_ = new bluetooth::shim::Timer("observing_timer");
@@ -79,10 +81,13 @@ void bluetooth::shim::Btm::StartUp(bluetooth::shim::Btm* btm) {

void bluetooth::shim::Btm::ShutDown(bluetooth::shim::Btm* btm) {
  CHECK(btm != nullptr);
  std::unique_lock<std::mutex> lock(btm->sync_mutex_);
  CHECK(btm->observing_timer_ != nullptr);
  CHECK(btm->scanning_timer_ != nullptr);
  delete btm->scanning_timer_;
  delete btm->observing_timer_;
  btm->scanning_timer_ = nullptr;
  btm->observing_timer_ = nullptr;
}

void bluetooth::shim::Btm::OnInquiryResult(std::string string_address,
+2 −0
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ class Btm {
  Timer* observing_timer_{nullptr};
  Timer* scanning_timer_{nullptr};

  std::mutex sync_mutex_;

  LegacyInquiryCompleteCallback legacy_inquiry_complete_callback_{};

  uint8_t active_inquiry_mode_ = 0;