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

Commit ad857237 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix call order for BTM shim RegisterInquiryCallbacks

This currently causes crash on bringup of GD stack

Bug: 149757450
Test: start stack with GD enabled
Change-Id: Ie86d007dd9fcbab102b7c1e95c97ae5d9989fa29
parent d9869cbc
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ void bluetooth::shim::Btm::StartUp(bluetooth::shim::Btm* btm) {
  btm->observing_timer_ = new bluetooth::shim::Timer("observing_timer");
  btm->scanning_timer_ = new bluetooth::shim::Timer("scanning_timer");

  btm->RegisterInquiryCallbacks();
}

void bluetooth::shim::Btm::ShutDown(bluetooth::shim::Btm* btm) {
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#include "types/class_of_device.h"
#include "types/raw_address.h"

static bluetooth::shim::Btm shim_btm;
bluetooth::shim::Btm shim_btm;

/**
 * Legacy bluetooth module global control block state
+5 −0
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@

#include "main/shim/entry.h"
#include "osi/include/future.h"
#include "osi/include/log.h"

#include "hci/controller.h"
#include "hci/hci_layer.h"
#include "hci/le_advertising_manager.h"
#include "hci/le_scanning_manager.h"
#include "main/shim/btm.h"
#include "neighbor/connectability.h"
#include "neighbor/discoverability.h"
#include "neighbor/inquiry.h"
@@ -36,8 +38,11 @@

using bluetooth::shim::GetGabeldorscheStack;

extern bluetooth::shim::Btm shim_btm;

future_t* bluetooth::shim::StartGabeldorscheStack() {
  GetGabeldorscheStack()->Start();
  shim_btm.RegisterInquiryCallbacks();
  return (future_t*)nullptr;
}