Turn channel map for advertising into property
Some radio folks would like this for their tests
Tag: #feature
Test: set property for tests
Change-Id: Ie6214724aee843e7b1776ec03acd24945df4572d
diff --git a/system/btif/src/btif_ble_advertiser.cc b/system/btif/src/btif_ble_advertiser.cc
index c0cdb7f..ac6e6a4 100644
--- a/system/btif/src/btif_ble_advertiser.cc
+++ b/system/btif/src/btif_ble_advertiser.cc
@@ -29,6 +29,7 @@
#include "btif_common.h"
#include "main/shim/le_advertising_manager.h"
#include "main/shim/shim.h"
+#include "osi/include/properties.h"
#include "stack/include/btu.h"
using base::Bind;
@@ -64,10 +65,14 @@
void parseParams(tBTM_BLE_ADV_PARAMS* p_params,
const AdvertiseParameters& params) {
+ // By default use all channels, but have property for tweaking.
+ int channel_map = osi_property_get_int32(
+ "persist.bluetooth.advertising_channel_map", params.channel_map);
+
p_params->advertising_event_properties = params.advertising_event_properties;
p_params->adv_int_min = params.min_interval;
p_params->adv_int_max = params.max_interval;
- p_params->channel_map = params.channel_map;
+ p_params->channel_map = channel_map;
p_params->adv_filter_policy = 0;
p_params->tx_power = params.tx_power;
p_params->primary_advertising_phy = params.primary_advertising_phy;