Loading sysprop/hfp.sysprop +16 −1 Original line number Diff line number Diff line module: "android.sysprop.bluetooth.Hfp" owner: Platform prop { api_name: "hf_client_features" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.hfp.hf_client_features.config" } prop { api_name: "hf_features" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.hfp.hf_features.config" } prop { api_name: "hf_services" type: Integer Loading @@ -17,4 +33,3 @@ prop { prop_name: "bluetooth.hfp.version.config" } system/bta/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -330,6 +330,7 @@ cc_test { "packages/modules/Bluetooth/system/utils/include", ], srcs: [ "hf_client/bta_hf_client_api.cc", "test/bta_hf_client_add_record_test.cc", ], header_libs: ["libbluetooth_headers"], Loading system/bta/hf_client/bta_hf_client_api.cc +30 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ #include <cstdint> #ifdef OS_ANDROID #include <hfp.sysprop.h> #endif #include "bt_trace.h" // Legacy trace logging #include "bta/hf_client/bta_hf_client_int.h" #include "bta/sys/bta_sys.h" Loading Loading @@ -204,3 +208,29 @@ void BTA_HfClientSendAT(uint16_t handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, * ******************************************************************************/ void BTA_HfClientDumpStatistics(int fd) { bta_hf_client_dump_statistics(fd); } /******************************************************************************* * * function get_default_hf_client_features * * description return the hf_client features. * value can be override via system property * * returns int * ******************************************************************************/ int get_default_hf_client_features() { #define DEFAULT_BTIF_HF_CLIENT_FEATURES \ (BTA_HF_CLIENT_FEAT_ECNR | BTA_HF_CLIENT_FEAT_3WAY | \ 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) #ifdef OS_ANDROID static const int features = android::sysprop::bluetooth::Hfp::hf_client_features().value_or( DEFAULT_BTIF_HF_CLIENT_FEATURES); return features; #else return DEFAULT_BTIF_HF_CLIENT_FEATURES; #endif } system/bta/include/bta_hf_client_api.h +11 −0 Original line number Diff line number Diff line Loading @@ -391,4 +391,15 @@ void BTA_HfClientSendAT(uint16_t handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, ******************************************************************************/ void BTA_HfClientDumpStatistics(int fd); /******************************************************************************* * * function get_default_hf_client_features * * description return the hf_client features. * value can be override via system property * * returns int * ******************************************************************************/ int get_default_hf_client_features(); #endif /* BTA_HF_CLIENT_API_H */ system/bta/test/bta_hf_client_add_record_test.cc +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ class BtaHfClientAddRecordTest : public ::testing::Test { }; TEST_F(BtaHfClientAddRecordTest, test_hf_client_add_record) { tBTA_HF_CLIENT_FEAT features = BTIF_HF_CLIENT_FEATURES; tBTA_HF_CLIENT_FEAT features = get_default_hf_client_features(); uint32_t sdp_handle = 0; uint8_t scn = 0; Loading Loading
sysprop/hfp.sysprop +16 −1 Original line number Diff line number Diff line module: "android.sysprop.bluetooth.Hfp" owner: Platform prop { api_name: "hf_client_features" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.hfp.hf_client_features.config" } prop { api_name: "hf_features" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.hfp.hf_features.config" } prop { api_name: "hf_services" type: Integer Loading @@ -17,4 +33,3 @@ prop { prop_name: "bluetooth.hfp.version.config" }
system/bta/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -330,6 +330,7 @@ cc_test { "packages/modules/Bluetooth/system/utils/include", ], srcs: [ "hf_client/bta_hf_client_api.cc", "test/bta_hf_client_add_record_test.cc", ], header_libs: ["libbluetooth_headers"], Loading
system/bta/hf_client/bta_hf_client_api.cc +30 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ #include <cstdint> #ifdef OS_ANDROID #include <hfp.sysprop.h> #endif #include "bt_trace.h" // Legacy trace logging #include "bta/hf_client/bta_hf_client_int.h" #include "bta/sys/bta_sys.h" Loading Loading @@ -204,3 +208,29 @@ void BTA_HfClientSendAT(uint16_t handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, * ******************************************************************************/ void BTA_HfClientDumpStatistics(int fd) { bta_hf_client_dump_statistics(fd); } /******************************************************************************* * * function get_default_hf_client_features * * description return the hf_client features. * value can be override via system property * * returns int * ******************************************************************************/ int get_default_hf_client_features() { #define DEFAULT_BTIF_HF_CLIENT_FEATURES \ (BTA_HF_CLIENT_FEAT_ECNR | BTA_HF_CLIENT_FEAT_3WAY | \ 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) #ifdef OS_ANDROID static const int features = android::sysprop::bluetooth::Hfp::hf_client_features().value_or( DEFAULT_BTIF_HF_CLIENT_FEATURES); return features; #else return DEFAULT_BTIF_HF_CLIENT_FEATURES; #endif }
system/bta/include/bta_hf_client_api.h +11 −0 Original line number Diff line number Diff line Loading @@ -391,4 +391,15 @@ void BTA_HfClientSendAT(uint16_t handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, ******************************************************************************/ void BTA_HfClientDumpStatistics(int fd); /******************************************************************************* * * function get_default_hf_client_features * * description return the hf_client features. * value can be override via system property * * returns int * ******************************************************************************/ int get_default_hf_client_features(); #endif /* BTA_HF_CLIENT_API_H */
system/bta/test/bta_hf_client_add_record_test.cc +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ class BtaHfClientAddRecordTest : public ::testing::Test { }; TEST_F(BtaHfClientAddRecordTest, test_hf_client_add_record) { tBTA_HF_CLIENT_FEAT features = BTIF_HF_CLIENT_FEATURES; tBTA_HF_CLIENT_FEAT features = get_default_hf_client_features(); uint32_t sdp_handle = 0; uint8_t scn = 0; Loading