diff options
-rw-r--r-- | sysprop/exported_include/android_bluetooth_sysprop.h | 3 | ||||
-rw-r--r-- | system/bta/ag/bta_ag_swb_aptx.cc | 2 | ||||
-rw-r--r-- | system/bta/dm/bta_dm_act.cc | 3 | ||||
-rw-r--r-- | system/bta/hf_client/bta_hf_client_api.cc | 3 | ||||
-rw-r--r-- | system/bta/hfp/bta_hfp_api.cc | 2 | ||||
-rw-r--r-- | system/btif/src/btif_av.cc | 2 | ||||
-rw-r--r-- | system/btif/src/btif_core.cc | 15 | ||||
-rw-r--r-- | system/btif/src/btif_hf.cc | 6 | ||||
-rw-r--r-- | system/btif/test/btif_hf_client_service_test.cc | 5 | ||||
-rw-r--r-- | system/gd/security/internal/security_manager_impl.cc | 4 | ||||
-rw-r--r-- | system/main/shim/acl_api.cc | 4 | ||||
-rw-r--r-- | system/stack/avrc/avrc_api.cc | 2 | ||||
-rw-r--r-- | system/stack/btm/btm_ble_gap.cc | 2 | ||||
-rw-r--r-- | system/stack/btm/btm_ble_sec.cc | 3 |
14 files changed, 30 insertions, 26 deletions
diff --git a/sysprop/exported_include/android_bluetooth_sysprop.h b/sysprop/exported_include/android_bluetooth_sysprop.h index 01aed4f3bc..50553ecc5b 100644 --- a/sysprop/exported_include/android_bluetooth_sysprop.h +++ b/sysprop/exported_include/android_bluetooth_sysprop.h @@ -22,6 +22,3 @@ #include <bta.sysprop.h> #include <device_id.sysprop.h> #include <hfp.sysprop.h> - -#define GET_SYSPROP(namespace, prop, default) \ - android::sysprop::bluetooth::namespace ::prop().value_or(default) diff --git a/system/bta/ag/bta_ag_swb_aptx.cc b/system/bta/ag/bta_ag_swb_aptx.cc index 76fbbd9a03..5943f6ec47 100644 --- a/system/bta/ag/bta_ag_swb_aptx.cc +++ b/system/bta/ag/bta_ag_swb_aptx.cc @@ -31,7 +31,7 @@ using namespace bluetooth; bool is_hfp_aptx_voice_enabled() { return com::android::bluetooth::flags::hfp_codec_aptx_voice() && - GET_SYSPROP(Hfp, codec_aptx_voice, false); + android::sysprop::bluetooth::Hfp::codec_aptx_voice().value_or(false); } static bool aptx_swb_codec_status; diff --git a/system/bta/dm/bta_dm_act.cc b/system/bta/dm/bta_dm_act.cc index a199c45a29..91ba485787 100644 --- a/system/bta/dm/bta_dm_act.cc +++ b/system/bta/dm/bta_dm_act.cc @@ -348,7 +348,8 @@ void bta_dm_disable() { if (BTM_GetNumAclLinks() == 0) { // Time to wait after receiving shutdown request to delay the actual // shutdown process. This time may be zero which invokes immediate shutdown. - const uint64_t disable_delay_ms = GET_SYSPROP(Bta, disable_delay, 200); + const uint64_t disable_delay_ms = + android::sysprop::bluetooth::Bta::disable_delay().value_or(200); switch (disable_delay_ms) { case 0: log::debug("Immediately disabling device manager"); diff --git a/system/bta/hf_client/bta_hf_client_api.cc b/system/bta/hf_client/bta_hf_client_api.cc index afdfde0cf8..d4730473a7 100644 --- a/system/bta/hf_client/bta_hf_client_api.cc +++ b/system/bta/hf_client/bta_hf_client_api.cc @@ -225,5 +225,6 @@ int get_default_hf_client_features() { BTA_HF_CLIENT_FEAT_CLI | BTA_HF_CLIENT_FEAT_VREC | BTA_HF_CLIENT_FEAT_VOL | \ BTA_HF_CLIENT_FEAT_ECS | BTA_HF_CLIENT_FEAT_ECC | BTA_HF_CLIENT_FEAT_CODEC) - return GET_SYSPROP(Hfp, hf_client_features, DEFAULT_BTIF_HF_CLIENT_FEATURES); + return android::sysprop::bluetooth::Hfp::hf_client_features().value_or( + DEFAULT_BTIF_HF_CLIENT_FEATURES); } diff --git a/system/bta/hfp/bta_hfp_api.cc b/system/bta/hfp/bta_hfp_api.cc index 25eb726a3a..a94d852fd9 100644 --- a/system/bta/hfp/bta_hfp_api.cc +++ b/system/bta/hfp/bta_hfp_api.cc @@ -19,5 +19,5 @@ #include <android_bluetooth_sysprop.h> int get_default_hfp_version() { - return GET_SYSPROP(Hfp, version, HFP_VERSION_1_7); + return android::sysprop::bluetooth::Hfp::version().value_or(HFP_VERSION_1_7); } diff --git a/system/btif/src/btif_av.cc b/system/btif/src/btif_av.cc index 70aba87587..d542bc31b3 100644 --- a/system/btif/src/btif_av.cc +++ b/system/btif/src/btif_av.cc @@ -3494,7 +3494,7 @@ bool btif_av_src_sink_coexist_enabled(void) { if (com::android::bluetooth::flags::a2dp_concurrent_source_sink()) { return is_a2dp_sink_property_enabled() && is_a2dp_source_property_enabled(); } - return GET_SYSPROP(A2dp, src_sink_coexist, false); + return android::sysprop::bluetooth::A2dp::src_sink_coexist().value_or(false); } static void bta_av_source_callback(tBTA_AV_EVT event, tBTA_AV* p_data) { diff --git a/system/btif/src/btif_core.cc b/system/btif/src/btif_core.cc index 31a9f23279..6c3a71184f 100644 --- a/system/btif/src/btif_core.cc +++ b/system/btif/src/btif_core.cc @@ -218,12 +218,15 @@ void btif_enable_bluetooth_evt() { bte_load_did_conf(BTE_DID_CONF_FILE); } else { tSDP_DI_RECORD record = { - .vendor = uint16_t( - GET_SYSPROP(DeviceIDProperties, vendor_id, LMP_COMPID_GOOGLE)), - .vendor_id_source = uint16_t(GET_SYSPROP( - DeviceIDProperties, vendor_id_source, DI_VENDOR_ID_SOURCE_BTSIG)), - .product = uint16_t(GET_SYSPROP(DeviceIDProperties, product_id, 0)), - .primary_record = true, + .vendor = + uint16_t(android::sysprop::bluetooth::DeviceIDProperties::vendor_id().value_or( + LMP_COMPID_GOOGLE)), + .vendor_id_source = uint16_t( + android::sysprop::bluetooth::DeviceIDProperties::vendor_id_source().value_or( + DI_VENDOR_ID_SOURCE_BTSIG)), + .product = uint16_t( + android::sysprop::bluetooth::DeviceIDProperties::product_id().value_or(0)), + .primary_record = true, }; uint32_t record_handle; diff --git a/system/btif/src/btif_hf.cc b/system/btif/src/btif_hf.cc index c61da1f5c3..d3981255d3 100644 --- a/system/btif/src/btif_hf.cc +++ b/system/btif/src/btif_hf.cc @@ -144,8 +144,8 @@ static bool is_active_device(const RawAddress& bd_addr) { } static tBTA_SERVICE_MASK get_BTIF_HF_SERVICES() { - return GET_SYSPROP(Hfp, hf_services, - BTA_HSP_SERVICE_MASK | BTA_HFP_SERVICE_MASK); + return android::sysprop::bluetooth::Hfp::hf_services().value_or(BTA_HSP_SERVICE_MASK | + BTA_HFP_SERVICE_MASK); } /* HF features supported at runtime */ @@ -162,7 +162,7 @@ static uint32_t get_hf_features() { BTA_AG_FEAT_UNAT) #endif - return GET_SYSPROP(Hfp, hf_features, DEFAULT_BTIF_HF_FEATURES); + return android::sysprop::bluetooth::Hfp::hf_features().value_or(DEFAULT_BTIF_HF_FEATURES); } /******************************************************************************* diff --git a/system/btif/test/btif_hf_client_service_test.cc b/system/btif/test/btif_hf_client_service_test.cc index b12f53c9df..76cb1c403f 100644 --- a/system/btif/test/btif_hf_client_service_test.cc +++ b/system/btif/test/btif_hf_client_service_test.cc @@ -9,7 +9,7 @@ static tBTA_HF_CLIENT_FEAT gFeatures; int get_default_hfp_version() { - return GET_SYSPROP(Hfp, version, HFP_VERSION_1_7); + return android::sysprop::bluetooth::Hfp::version().value_or(HFP_VERSION_1_7); } int get_default_hf_client_features() { @@ -18,7 +18,8 @@ int get_default_hf_client_features() { BTA_HF_CLIENT_FEAT_CLI | BTA_HF_CLIENT_FEAT_VREC | BTA_HF_CLIENT_FEAT_VOL | \ BTA_HF_CLIENT_FEAT_ECS | BTA_HF_CLIENT_FEAT_ECC | BTA_HF_CLIENT_FEAT_CODEC) - return GET_SYSPROP(Hfp, hf_client_features, DEFAULT_BTIF_HF_CLIENT_FEATURES); + return android::sysprop::bluetooth::Hfp::hf_client_features().value_or( + DEFAULT_BTIF_HF_CLIENT_FEATURES); } tBTA_STATUS BTA_HfClientEnable(tBTA_HF_CLIENT_CBACK* p_cback, diff --git a/system/gd/security/internal/security_manager_impl.cc b/system/gd/security/internal/security_manager_impl.cc index 1f5a8a0483..566f991f34 100644 --- a/system/gd/security/internal/security_manager_impl.cc +++ b/system/gd/security/internal/security_manager_impl.cc @@ -117,9 +117,9 @@ void SecurityManagerImpl::Init() { /* Default to 7 minutes minimum, 15 minutes maximum for random address refreshing; * device can override. */ auto minimum_rotation_time = std::chrono::minutes( - GET_SYSPROP(Ble, random_address_rotation_interval_min, 7)); + android::sysprop::bluetooth::Ble::random_address_rotation_interval_min().value_or(7)); auto maximum_rotation_time = std::chrono::minutes( - GET_SYSPROP(Ble, random_address_rotation_interval_max, 15)); + android::sysprop::bluetooth::Ble::random_address_rotation_interval_max().value_or(15)); acl_manager_->SetPrivacyPolicyForInitiatorAddress( address_policy, address_with_type, minimum_rotation_time, maximum_rotation_time); diff --git a/system/main/shim/acl_api.cc b/system/main/shim/acl_api.cc index 39bdffbed5..929f3ab97d 100644 --- a/system/main/shim/acl_api.cc +++ b/system/main/shim/acl_api.cc @@ -116,9 +116,9 @@ void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { /* Default to 7 minutes minimum, 15 minutes maximum for random address refreshing; * device can override. */ auto minimum_rotation_time = std::chrono::minutes( - GET_SYSPROP(Ble, random_address_rotation_interval_min, 7)); + android::sysprop::bluetooth::Ble::random_address_rotation_interval_min().value_or(7)); auto maximum_rotation_time = std::chrono::minutes( - GET_SYSPROP(Ble, random_address_rotation_interval_max, 15)); + android::sysprop::bluetooth::Ble::random_address_rotation_interval_max().value_or(15)); Stack::GetInstance() ->GetStackManager() diff --git a/system/stack/avrc/avrc_api.cc b/system/stack/avrc/avrc_api.cc index b31915a1b3..a567d59ce4 100644 --- a/system/stack/avrc/avrc_api.cc +++ b/system/stack/avrc/avrc_api.cc @@ -93,7 +93,7 @@ static const uint8_t avrc_ctrl_event_map[] = { * *****************************************************************************/ bool avrcp_absolute_volume_is_enabled() { - return GET_SYSPROP(Avrcp, absolute_volume, true); + return android::sysprop::bluetooth::Avrcp::absolute_volume().value_or(true); } /****************************************************************************** diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc index 65187464f1..5eac9a18bb 100644 --- a/system/stack/btm/btm_ble_gap.cc +++ b/system/stack/btm/btm_ble_gap.cc @@ -197,7 +197,7 @@ AdvertisingCache cache; bool ble_vnd_is_included() { // replace build time config BLE_VND_INCLUDED with runtime - return GET_SYSPROP(Ble, vnd_included, true); + return android::sysprop::bluetooth::Ble::vnd_included().value_or(true); } static tBTM_BLE_CTRL_FEATURES_CBACK* p_ctrl_le_feature_rd_cmpl_cback = NULL; diff --git a/system/stack/btm/btm_ble_sec.cc b/system/stack/btm/btm_ble_sec.cc index 167c8e7485..aab79ea7d2 100644 --- a/system/stack/btm/btm_ble_sec.cc +++ b/system/stack/btm/btm_ble_sec.cc @@ -1232,7 +1232,8 @@ tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, } // Some controllers may not like encrypting both transports at the same time - bool allow_le_enc_with_bredr = GET_SYSPROP(Ble, allow_enc_with_bredr, false); + bool allow_le_enc_with_bredr = + android::sysprop::bluetooth::Ble::allow_enc_with_bredr().value_or(false); if (!allow_le_enc_with_bredr && p_rec->sec_rec.is_security_state_bredr_encrypting()) { log::warn("BR/EDR link encryption is active, Busy!"); |