Loading system/conf/bt_stack.conf +3 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,9 @@ TRC_HID_DEV=2 # SMP Pair options (formatted as hex bytes) auth, io, ikey, rkey, ksize #PTS_SmpOptions=0xD,0x4,0xf,0xf,0x10 # PTS AVRCP Test mode #PTS_AvrcpTest=true # SMP Certification Failure Cases # Set any of the following SMP error values (from smp_api_types.h) # to induce pairing failues for various PTS SMP test cases. Loading system/internal_include/stack_config.h +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ static const char STACK_CONFIG_MODULE[] = "stack_config_module"; typedef struct { bool (*get_trace_config_enabled)(void); bool (*get_pts_avrcp_test)(void); bool (*get_pts_secure_only_mode)(void); bool (*get_pts_conn_updates_disabled)(void); bool (*get_pts_crosskey_sdp_disable)(void); Loading system/main/stack_config.cc +11 −7 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ namespace { const char* TRACE_CONFIG_ENABLED_KEY = "TraceConf"; const char* PTS_AVRCP_TEST = "PTS_AvrcpTest"; const char* PTS_SECURE_ONLY_MODE = "PTS_SecurePairOnly"; const char* PTS_LE_CONN_UPDATED_DISABLED = "PTS_DisableConnUpdates"; const char* PTS_DISABLE_SDP_LE_PAIR = "PTS_DisableSDPOnLEPair"; Loading Loading @@ -77,6 +78,11 @@ static bool get_trace_config_enabled(void) { TRACE_CONFIG_ENABLED_KEY, false); } static bool get_pts_avrcp_test(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_AVRCP_TEST, false); } static bool get_pts_secure_only_mode(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_SECURE_ONLY_MODE, false); Loading Loading @@ -104,12 +110,10 @@ static int get_pts_smp_failure_case(void) { static config_t* get_all(void) { return config.get(); } const stack_config_t interface = {get_trace_config_enabled, get_pts_secure_only_mode, get_pts_conn_updates_disabled, get_pts_crosskey_sdp_disable, get_pts_smp_options, get_pts_smp_failure_case, get_all}; const stack_config_t interface = { get_trace_config_enabled, get_pts_avrcp_test, get_pts_secure_only_mode, get_pts_conn_updates_disabled, get_pts_crosskey_sdp_disable, get_pts_smp_options, get_pts_smp_failure_case, get_all}; const stack_config_t* stack_config_get_interface(void) { return &interface; } system/profile/avrcp/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ cc_library_static { host_supported: true, include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/btcore/include", "packages/modules/Bluetooth/system/internal_include", "packages/modules/Bluetooth/system/stack/include", ], Loading @@ -25,6 +26,7 @@ cc_test { host_supported: true, include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/btcore/include", "packages/modules/Bluetooth/system/internal_include", "packages/modules/Bluetooth/system/stack/include", ], Loading system/profile/avrcp/device.cc +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include "connection_handler.h" #include "device.h" #include "stack_config.h" #include "packet/avrcp/avrcp_reject_packet.h" #include "packet/avrcp/general_reject_packet.h" Loading Loading @@ -369,6 +370,10 @@ void Device::TrackChangedNotificationResponse(uint8_t label, bool interim, if (curr_song_id == "") { DEVICE_LOG(WARNING) << "Empty media ID"; uid = 0; if (stack_config_get_interface()->get_pts_avrcp_test()) { DEVICE_LOG(WARNING) << __func__ << ": pts test mode"; uid = 0xffffffffffffffff; } } auto response = RegisterNotificationResponseBuilder::MakeTrackChangedBuilder( Loading Loading
system/conf/bt_stack.conf +3 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,9 @@ TRC_HID_DEV=2 # SMP Pair options (formatted as hex bytes) auth, io, ikey, rkey, ksize #PTS_SmpOptions=0xD,0x4,0xf,0xf,0x10 # PTS AVRCP Test mode #PTS_AvrcpTest=true # SMP Certification Failure Cases # Set any of the following SMP error values (from smp_api_types.h) # to induce pairing failues for various PTS SMP test cases. Loading
system/internal_include/stack_config.h +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ static const char STACK_CONFIG_MODULE[] = "stack_config_module"; typedef struct { bool (*get_trace_config_enabled)(void); bool (*get_pts_avrcp_test)(void); bool (*get_pts_secure_only_mode)(void); bool (*get_pts_conn_updates_disabled)(void); bool (*get_pts_crosskey_sdp_disable)(void); Loading
system/main/stack_config.cc +11 −7 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ namespace { const char* TRACE_CONFIG_ENABLED_KEY = "TraceConf"; const char* PTS_AVRCP_TEST = "PTS_AvrcpTest"; const char* PTS_SECURE_ONLY_MODE = "PTS_SecurePairOnly"; const char* PTS_LE_CONN_UPDATED_DISABLED = "PTS_DisableConnUpdates"; const char* PTS_DISABLE_SDP_LE_PAIR = "PTS_DisableSDPOnLEPair"; Loading Loading @@ -77,6 +78,11 @@ static bool get_trace_config_enabled(void) { TRACE_CONFIG_ENABLED_KEY, false); } static bool get_pts_avrcp_test(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_AVRCP_TEST, false); } static bool get_pts_secure_only_mode(void) { return config_get_bool(*config, CONFIG_DEFAULT_SECTION, PTS_SECURE_ONLY_MODE, false); Loading Loading @@ -104,12 +110,10 @@ static int get_pts_smp_failure_case(void) { static config_t* get_all(void) { return config.get(); } const stack_config_t interface = {get_trace_config_enabled, get_pts_secure_only_mode, get_pts_conn_updates_disabled, get_pts_crosskey_sdp_disable, get_pts_smp_options, get_pts_smp_failure_case, get_all}; const stack_config_t interface = { get_trace_config_enabled, get_pts_avrcp_test, get_pts_secure_only_mode, get_pts_conn_updates_disabled, get_pts_crosskey_sdp_disable, get_pts_smp_options, get_pts_smp_failure_case, get_all}; const stack_config_t* stack_config_get_interface(void) { return &interface; }
system/profile/avrcp/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ cc_library_static { host_supported: true, include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/btcore/include", "packages/modules/Bluetooth/system/internal_include", "packages/modules/Bluetooth/system/stack/include", ], Loading @@ -25,6 +26,7 @@ cc_test { host_supported: true, include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/btcore/include", "packages/modules/Bluetooth/system/internal_include", "packages/modules/Bluetooth/system/stack/include", ], Loading
system/profile/avrcp/device.cc +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include "connection_handler.h" #include "device.h" #include "stack_config.h" #include "packet/avrcp/avrcp_reject_packet.h" #include "packet/avrcp/general_reject_packet.h" Loading Loading @@ -369,6 +370,10 @@ void Device::TrackChangedNotificationResponse(uint8_t label, bool interim, if (curr_song_id == "") { DEVICE_LOG(WARNING) << "Empty media ID"; uid = 0; if (stack_config_get_interface()->get_pts_avrcp_test()) { DEVICE_LOG(WARNING) << __func__ << ": pts test mode"; uid = 0xffffffffffffffff; } } auto response = RegisterNotificationResponseBuilder::MakeTrackChangedBuilder( Loading