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

Commit d6da2daa authored by Chris Manton's avatar Chris Manton Committed by android-build-merger
Browse files

Merge "Clear static btm checks during shutdown"

am: b10c6ece

Change-Id: I8a43e78fc5fc3c167d1dd0058d6e34d71de9d266
parents fa464118 b10c6ece
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;