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

Commit 185cd018 authored by Chris Manton's avatar Chris Manton
Browse files

Pull various Inits into parent tBTM_CB::Init structure

Towards encapsulation

Bug: 163134718
Tag: #refactor
Test: gd/cert/run

Change-Id: I7be4efb156e1f84904f69b38763f6527e9764f23
parent 33df351b
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -343,9 +343,24 @@ typedef struct {
    security_mode = initial_security_mode;
    pairing_bda = RawAddress::kAny;
    sec_dev_rec = list_new(osi_free);

    /* Initialize BTM component structures */
    btm_inq_vars.Init(); /* Inquiry Database and Structures */
    acl_cb_.Init();      /* ACL Database and Structures */
    sco_cb.Init();       /* SCO Database and Structures (If included) */
    devcb.Init();

    history_ = std::make_shared<TimestampedStringCircularBuffer>(40);
    CHECK(history_ != nullptr);
    history_->Push(std::string("Initialized btm history"));
  }

  void Free() {
    history_.reset();

    devcb.Free();
    btm_inq_vars.Free();

    fixed_queue_free(page_queue, nullptr);
    page_queue = nullptr;