Loading system/bta/av/bta_av_aact.cc +3 −2 Original line number Diff line number Diff line Loading @@ -843,8 +843,9 @@ void bta_av_do_disc_a2dp(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) { "Initiate SDP discovery for peer {} : uuid_int=0x{:x} sdp_uuid=0x{:x}", ADDRESS_TO_LOGGABLE_CSTR(p_scb->PeerAddress()), p_scb->uuid_int, sdp_uuid); tA2DP_STATUS find_service_status = A2DP_FindService( sdp_uuid, p_scb->PeerAddress(), &db_params, bta_av_a2dp_sdp_cback); tA2DP_STATUS find_service_status = A2DP_FindService(sdp_uuid, p_scb->PeerAddress(), &db_params, base::Bind(bta_av_a2dp_sdp_cback)); if (find_service_status != A2DP_SUCCESS) { log::error( "A2DP_FindService() failed for peer {} uuid_int=0x{:x} sdp_uuid=0x{:x} " Loading system/stack/a2dp/a2dp_api.cc +5 −5 Original line number Diff line number Diff line Loading @@ -149,8 +149,8 @@ static void a2dp_sdp_cback(UNUSED_ATTR const RawAddress& bd_addr, a2dp_cb.find.service_uuid = 0; osi_free_and_reset((void**)&a2dp_cb.find.p_db); /* return info from sdp record in app callback function */ if (a2dp_cb.find.p_cback != NULL) { (*a2dp_cb.find.p_cback)(found, &a2dp_svc, peer_address); if (!a2dp_cb.find.p_cback.is_null()) { a2dp_cb.find.p_cback.Run(found, &a2dp_svc, peer_address); } return; Loading Loading @@ -305,10 +305,10 @@ tA2DP_STATUS A2DP_AddRecord(uint16_t service_uuid, char* p_service_name, *****************************************************************************/ tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr, tA2DP_SDP_DB_PARAMS* p_db, tA2DP_FIND_CBACK* p_cback) { tA2DP_FIND_CBACK p_cback) { if ((service_uuid != UUID_SERVCLASS_AUDIO_SOURCE && service_uuid != UUID_SERVCLASS_AUDIO_SINK) || p_db == NULL || p_cback == NULL) { p_db == NULL || p_cback.is_null()) { log::error( "Cannot find service for peer {} UUID 0x{:04x}: invalid parameters", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), service_uuid); Loading Loading @@ -348,7 +348,7 @@ tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr, if (!get_legacy_stack_sdp_api()->service.SDP_ServiceSearchAttributeRequest( bd_addr, a2dp_cb.find.p_db, a2dp_sdp_cback)) { a2dp_cb.find.service_uuid = 0; a2dp_cb.find.p_cback = NULL; a2dp_cb.find.p_cback.Reset(); osi_free_and_reset((void**)&a2dp_cb.find.p_db); log::error("Cannot find service for peer {} UUID 0x{:04x}: SDP error", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), service_uuid); Loading system/stack/a2dp/a2dp_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ /* Control block used by A2DP_FindService(). */ typedef struct { tA2DP_FIND_CBACK* p_cback; /* pointer to application callback */ tA2DP_FIND_CBACK p_cback; /* application callback */ tSDP_DISCOVERY_DB* p_db; /* pointer to discovery database */ uint16_t service_uuid; /* service UUID of search */ } tA2DP_FIND_CB; Loading system/stack/include/a2dp_api.h +5 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ #ifndef A2DP_API_H #define A2DP_API_H #include <base/functional/callback.h> #include <cstdint> #include "stack/include/a2dp_constants.h" Loading Loading @@ -83,8 +85,8 @@ typedef struct { } tA2DP_Service; /* This is the callback to notify the result of the SDP discovery process. */ typedef void(tA2DP_FIND_CBACK)(bool found, tA2DP_Service* p_service, const RawAddress& peer_address); using tA2DP_FIND_CBACK = base::Callback<void( bool found, tA2DP_Service* p_service, const RawAddress& peer_address)>; /***************************************************************************** * external function declarations Loading Loading @@ -160,7 +162,7 @@ tA2DP_STATUS A2DP_AddRecord(uint16_t service_uuid, char* p_service_name, *****************************************************************************/ tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr, tA2DP_SDP_DB_PARAMS* p_db, tA2DP_FIND_CBACK* p_cback); tA2DP_FIND_CBACK p_cback); /****************************************************************************** * Loading system/stack/test/fuzzers/a2dp/a2dpFuzzFunctions.h +3 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <vector> #include "a2dp_api.h" #include "base/functional/bind.h" #include "fuzzers/a2dp/a2dpFuzzHelpers.h" #include "fuzzers/common/commonFuzzHelpers.h" #include "fuzzers/sdp/sdpFuzzFunctions.h" Loading Loading @@ -71,7 +72,8 @@ std::vector<std::function<void(FuzzedDataProvider*)>> a2dp_operations = { const RawAddress bd_addr = generateRawAddress(fdp); uint16_t service_uuid = fdp->ConsumeBool() ? UUID_SERVCLASS_AUDIO_SOURCE : UUID_SERVCLASS_AUDIO_SINK; A2DP_FindService(service_uuid, bd_addr, &p_db, a2dp_find_callback); A2DP_FindService(service_uuid, bd_addr, &p_db, base::Bind(a2dp_find_callback)); }, // A2DP_GetAvdtpVersion Loading Loading
system/bta/av/bta_av_aact.cc +3 −2 Original line number Diff line number Diff line Loading @@ -843,8 +843,9 @@ void bta_av_do_disc_a2dp(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) { "Initiate SDP discovery for peer {} : uuid_int=0x{:x} sdp_uuid=0x{:x}", ADDRESS_TO_LOGGABLE_CSTR(p_scb->PeerAddress()), p_scb->uuid_int, sdp_uuid); tA2DP_STATUS find_service_status = A2DP_FindService( sdp_uuid, p_scb->PeerAddress(), &db_params, bta_av_a2dp_sdp_cback); tA2DP_STATUS find_service_status = A2DP_FindService(sdp_uuid, p_scb->PeerAddress(), &db_params, base::Bind(bta_av_a2dp_sdp_cback)); if (find_service_status != A2DP_SUCCESS) { log::error( "A2DP_FindService() failed for peer {} uuid_int=0x{:x} sdp_uuid=0x{:x} " Loading
system/stack/a2dp/a2dp_api.cc +5 −5 Original line number Diff line number Diff line Loading @@ -149,8 +149,8 @@ static void a2dp_sdp_cback(UNUSED_ATTR const RawAddress& bd_addr, a2dp_cb.find.service_uuid = 0; osi_free_and_reset((void**)&a2dp_cb.find.p_db); /* return info from sdp record in app callback function */ if (a2dp_cb.find.p_cback != NULL) { (*a2dp_cb.find.p_cback)(found, &a2dp_svc, peer_address); if (!a2dp_cb.find.p_cback.is_null()) { a2dp_cb.find.p_cback.Run(found, &a2dp_svc, peer_address); } return; Loading Loading @@ -305,10 +305,10 @@ tA2DP_STATUS A2DP_AddRecord(uint16_t service_uuid, char* p_service_name, *****************************************************************************/ tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr, tA2DP_SDP_DB_PARAMS* p_db, tA2DP_FIND_CBACK* p_cback) { tA2DP_FIND_CBACK p_cback) { if ((service_uuid != UUID_SERVCLASS_AUDIO_SOURCE && service_uuid != UUID_SERVCLASS_AUDIO_SINK) || p_db == NULL || p_cback == NULL) { p_db == NULL || p_cback.is_null()) { log::error( "Cannot find service for peer {} UUID 0x{:04x}: invalid parameters", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), service_uuid); Loading Loading @@ -348,7 +348,7 @@ tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr, if (!get_legacy_stack_sdp_api()->service.SDP_ServiceSearchAttributeRequest( bd_addr, a2dp_cb.find.p_db, a2dp_sdp_cback)) { a2dp_cb.find.service_uuid = 0; a2dp_cb.find.p_cback = NULL; a2dp_cb.find.p_cback.Reset(); osi_free_and_reset((void**)&a2dp_cb.find.p_db); log::error("Cannot find service for peer {} UUID 0x{:04x}: SDP error", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), service_uuid); Loading
system/stack/a2dp/a2dp_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ /* Control block used by A2DP_FindService(). */ typedef struct { tA2DP_FIND_CBACK* p_cback; /* pointer to application callback */ tA2DP_FIND_CBACK p_cback; /* application callback */ tSDP_DISCOVERY_DB* p_db; /* pointer to discovery database */ uint16_t service_uuid; /* service UUID of search */ } tA2DP_FIND_CB; Loading
system/stack/include/a2dp_api.h +5 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ #ifndef A2DP_API_H #define A2DP_API_H #include <base/functional/callback.h> #include <cstdint> #include "stack/include/a2dp_constants.h" Loading Loading @@ -83,8 +85,8 @@ typedef struct { } tA2DP_Service; /* This is the callback to notify the result of the SDP discovery process. */ typedef void(tA2DP_FIND_CBACK)(bool found, tA2DP_Service* p_service, const RawAddress& peer_address); using tA2DP_FIND_CBACK = base::Callback<void( bool found, tA2DP_Service* p_service, const RawAddress& peer_address)>; /***************************************************************************** * external function declarations Loading Loading @@ -160,7 +162,7 @@ tA2DP_STATUS A2DP_AddRecord(uint16_t service_uuid, char* p_service_name, *****************************************************************************/ tA2DP_STATUS A2DP_FindService(uint16_t service_uuid, const RawAddress& bd_addr, tA2DP_SDP_DB_PARAMS* p_db, tA2DP_FIND_CBACK* p_cback); tA2DP_FIND_CBACK p_cback); /****************************************************************************** * Loading
system/stack/test/fuzzers/a2dp/a2dpFuzzFunctions.h +3 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <vector> #include "a2dp_api.h" #include "base/functional/bind.h" #include "fuzzers/a2dp/a2dpFuzzHelpers.h" #include "fuzzers/common/commonFuzzHelpers.h" #include "fuzzers/sdp/sdpFuzzFunctions.h" Loading Loading @@ -71,7 +72,8 @@ std::vector<std::function<void(FuzzedDataProvider*)>> a2dp_operations = { const RawAddress bd_addr = generateRawAddress(fdp); uint16_t service_uuid = fdp->ConsumeBool() ? UUID_SERVCLASS_AUDIO_SOURCE : UUID_SERVCLASS_AUDIO_SINK; A2DP_FindService(service_uuid, bd_addr, &p_db, a2dp_find_callback); A2DP_FindService(service_uuid, bd_addr, &p_db, base::Bind(a2dp_find_callback)); }, // A2DP_GetAvdtpVersion Loading