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

Commit fb145b12 authored by Yongqin Liu's avatar Yongqin Liu Committed by William Escande
Browse files

Add ble sysprop for vnd_included



The original BLE_VND_INCLUDED define method cannot be override
on runtime and some targets need to disable this feature(Eg: hikey960 board)

Test: m .
Test: bluetooth enabled by default after boot with the hikey960 board
Bug: 302408538

Change-Id: I6da644a22056c8198b0dcd63b98c12fe829d487f
Signed-off-by: default avatarYongqin Liu <yongqin.liu@linaro.org>
parent 7efe7bb4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ sysprop_library {
    srcs: [
        "a2dp.sysprop",
        "avrcp.sysprop",
        "ble.sysprop",
        "bta.sysprop",
        "hfp.sysprop",
        "pan.sysprop",

sysprop/ble.sysprop

0 → 100644
+10 −0
Original line number Diff line number Diff line
module: "android.sysprop.bluetooth.Ble"
owner: Platform

prop {
    api_name: "vnd_included"
    type: Boolean
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.ble.vnd.included"
}
+8 −16
Original line number Diff line number Diff line
@@ -64,9 +64,9 @@
using namespace bluetooth::legacy::stack::sdp;
using bluetooth::Uuid;

bool ble_vnd_is_included();
void BTIF_dm_disable();
void BTIF_dm_enable();
void btm_ble_adv_init(void);
void btm_ble_scanner_init(void);

static uint8_t bta_dm_pin_cback(const RawAddress& bd_addr, DEV_CLASS dev_class,
@@ -103,9 +103,7 @@ static void bta_dm_ble_id_key_cback(uint8_t key_type,
                                    tBTM_BLE_LOCAL_KEYS* p_key);
static uint8_t bta_dm_sirk_verifiction_cback(const RawAddress& bd_addr);
tBTM_CONTRL_STATE bta_dm_pm_obtain_controller_state(void);
#if (BLE_VND_INCLUDED == TRUE)
static void bta_dm_ctrl_features_rd_cmpl_cback(tHCI_STATUS result);
#endif

#ifndef BTA_DM_BLE_ADV_CHNL_MAP
#define BTA_DM_BLE_ADV_CHNL_MAP \
@@ -353,17 +351,13 @@ void BTA_dm_on_hw_on() {
  BTM_WritePageTimeout(osi_property_get_int32(PROPERTY_PAGE_TIMEOUT,
                                              p_bta_dm_cfg->page_timeout));

#if (BLE_VND_INCLUDED == TRUE)
  if (ble_vnd_is_included()) {
    BTM_BleReadControllerFeatures(bta_dm_ctrl_features_rd_cmpl_cback);
#else
  /* If VSC multi adv commands are available, advertising will be initialized
   * when capabilities are read. If they are not available, initialize
   * advertising here */
  btm_ble_adv_init();
  } else {
    /* Set controller features even if vendor support is not included */
    if (bta_dm_cb.p_sec_cback)
      bta_dm_cb.p_sec_cback(BTA_DM_LE_FEATURES_READ, NULL);
#endif
  }

  btm_ble_scanner_init();

@@ -2738,7 +2732,6 @@ void bta_dm_ble_reset_id(void) {
  bluetooth::shim::BTM_BleResetId();
}

#if (BLE_VND_INCLUDED == TRUE)
/*******************************************************************************
 *
 * Function         bta_dm_ctrl_features_rd_cmpl_cback
@@ -2758,7 +2751,6 @@ static void bta_dm_ctrl_features_rd_cmpl_cback(tHCI_STATUS result) {
                     result);
  }
}
#endif /* BLE_VND_INCLUDED */

/*******************************************************************************
 *
+0 −8
Original line number Diff line number Diff line
@@ -499,14 +499,6 @@
#define LOCAL_BLE_CONTROLLER_ID 1
#endif

/*
 * Toggles support for vendor specific extensions such as RPA offloading,
 * feature discovery, multi-adv etc.
 */
#ifndef BLE_VND_INCLUDED
#define BLE_VND_INCLUDED TRUE
#endif

/* The maximum number of simultaneous applications that can register with LE
 * L2CAP. */
#ifndef BLE_MAX_L2CAP_CLIENTS
+2 −0
Original line number Diff line number Diff line
@@ -322,6 +322,7 @@ cc_library_static {
        "libbt-hci",
        "libbt-platform-protos-lite",
        "libbt_shim_bridge",
        "libcom.android.sysprop.bluetooth",
    ],
    shared_libs: [
        "libPlatformProperties",
@@ -1567,6 +1568,7 @@ cc_test {
        "libbt_shim_ffi",
        "libbtdevice",
        "libchrome",
        "libcom.android.sysprop.bluetooth",
        "libevent",
        "libgmock",
        "liblc3",
Loading