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

Commit 24bad913 authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove BTA_DM_LINK_POLICY_SETTINGS & friends

it's essentially a constant, set to a variable which never changes

and it's only used once

inline it

q.e.d.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Icd4f61ae6c7eb36894808f5ee3b5514d95131fc7
parent 00dfc046
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -32,12 +32,6 @@
#include "bta_jv_api.h"
#include "bta_sys.h"

#ifndef BTA_DM_LINK_POLICY_SETTINGS
#define BTA_DM_LINK_POLICY_SETTINGS                        \
  (HCI_ENABLE_MASTER_SLAVE_SWITCH | HCI_ENABLE_HOLD_MODE | \
   HCI_ENABLE_SNIFF_MODE | HCI_ENABLE_PARK_MODE)
#endif

/* page timeout in 625uS */
#ifndef BTA_DM_PAGE_TIMEOUT
#define BTA_DM_PAGE_TIMEOUT 8192
@@ -64,8 +58,6 @@
const tBTA_DM_CFG bta_dm_cfg = {
    /* mobile phone COD */
    BTA_DM_COD,
    /* link policy settings */
    BTA_DM_LINK_POLICY_SETTINGS,
    /* page timeout in 625uS */
    BTA_DM_PAGE_TIMEOUT,
    /* link supervision timeout in 625uS*/
+0 −2
Original line number Diff line number Diff line
@@ -388,8 +388,6 @@ enum {

typedef struct {
  DEV_CLASS dev_class; /* local device class */
  uint16_t
      policy_settings;   /* link policy setting hold, sniff, park, MS switch */
  uint16_t page_timeout; /* timeout for page in slots */
  uint16_t link_timeout; /* link supervision timeout in slots */
  bool avoid_scatter; /* true to avoid scatternet when av is streaming (be the
+3 −2
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
#define LOG_TAG "btm_acl"

#include <cstdint>
#include "bta/dm/bta_dm_int.h"
#include "bta/sys/bta_sys.h"
#include "common/metrics.h"
#include "device/include/controller.h"
@@ -106,7 +105,9 @@ void btm_acl_init(void) {
}

void BTM_acl_after_controller_started() {
  btm_set_default_link_policy(p_bta_dm_cfg->policy_settings);
  btm_set_default_link_policy(HCI_ENABLE_MASTER_SLAVE_SWITCH |
                              HCI_ENABLE_HOLD_MODE | HCI_ENABLE_SNIFF_MODE |
                              HCI_ENABLE_PARK_MODE);
}

/*******************************************************************************