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

Commit 28b3405a authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Properly init bta_dm control block

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

Change-Id: I3564ee73c396d088c62b8e771f16e8a427ddb299
parent ff6eca0c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ void bta_dm_enable(tBTA_DM_SEC_CBACK* p_sec_cback) {
 *
 ******************************************************************************/
void bta_dm_init_cb(void) {
  memset(&bta_dm_cb, 0, sizeof(bta_dm_cb));
  bta_dm_cb = {};
  bta_dm_cb.disable_timer = alarm_new("bta_dm.disable_timer");
  bta_dm_cb.switch_delay_timer = alarm_new("bta_dm.switch_delay_timer");
  for (size_t i = 0; i < BTA_DM_NUM_PM_TIMER; i++) {
@@ -301,7 +301,7 @@ void bta_dm_deinit_cb(void) {
      alarm_free(bta_dm_cb.pm_timer[i].timer[j]);
    }
  }
  memset(&bta_dm_cb, 0, sizeof(bta_dm_cb));
  bta_dm_cb = {};
}

void BTA_dm_on_hw_off() {
+1 −3
Original line number Diff line number Diff line
@@ -36,9 +36,7 @@ tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff) { return BTM_SUCCESS; }

class BtaCustUuid : public testing::Test {
 protected:
  void SetUp() override {
    memset(&bta_dm_cb, 0, sizeof(bta_dm_cb));
  }
  void SetUp() override { bta_dm_cb = {}; }
};

namespace {