diff options
Diffstat (limited to 'system/stack/sdp/sdp_utils.cc')
-rw-r--r-- | system/stack/sdp/sdp_utils.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/system/stack/sdp/sdp_utils.cc b/system/stack/sdp/sdp_utils.cc index 44078ae720..761883e60e 100644 --- a/system/stack/sdp/sdp_utils.cc +++ b/system/stack/sdp/sdp_utils.cc @@ -22,6 +22,9 @@ * ******************************************************************************/ +#include <base/logging.h> +#include <log/log.h> + #include <array> #include <cstdint> #include <cstring> @@ -40,8 +43,6 @@ #include "types/bluetooth/uuid.h" #include "types/raw_address.h" -#include <base/logging.h> - using bluetooth::Uuid; static const uint8_t sdp_base_uuid[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, @@ -126,6 +127,10 @@ static uint16_t sdpu_find_most_specific_service_uuid(tSDP_DISC_REC* p_rec) { if (p_attr->attr_id == ATTR_ID_SERVICE_CLASS_ID_LIST && SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) == DATA_ELE_SEQ_DESC_TYPE) { tSDP_DISC_ATTR* p_first_attr = p_attr->attr_value.v.p_sub_attr; + if (p_first_attr == nullptr) { + android_errorWriteLog(0x534e4554, "227203684"); + return 0; + } if (SDP_DISC_ATTR_TYPE(p_first_attr->attr_len_type) == UUID_DESC_TYPE && SDP_DISC_ATTR_LEN(p_first_attr->attr_len_type) == 2) { return p_first_attr->attr_value.v.u16; @@ -273,8 +278,9 @@ void sdpu_log_attribute_metrics(const RawAddress& bda, // [N - native]::SDP::[DIP - Device ID Profile] ss << "N:SDP::DIP::" << loghex(di_record.rec.vendor_id_source); log_manufacturer_info( - bda, android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL, - ss.str(), loghex(di_record.rec.vendor), loghex(di_record.rec.product), + bda, android::bluetooth::AddressTypeEnum::ADDRESS_TYPE_PUBLIC, + android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL, ss.str(), + loghex(di_record.rec.vendor), loghex(di_record.rec.product), loghex(di_record.rec.version), ""); std::string bda_string = bda.ToString(); |