summaryrefslogtreecommitdiff
path: root/system/common/metrics.cc
diff options
context:
space:
mode:
author Chen Chen <cncn@google.com> 2022-06-02 15:00:20 -0700
committer Chen Chen <cncn@google.com> 2022-06-07 01:21:41 +0000
commitc08fc8803bb3b63f0f5c16a56453acc7a265819f (patch)
tree1fd3b57eca47396086afcd28393a88a23db329f6 /system/common/metrics.cc
parent83094ae5f5f8842c517f99431d1be7f65ad27b3c (diff)
BluetoothMetrics: Log the first 3 byte of MAC address to the metrics server
Bug: 230023257 Test: atest BluetoothInstrumentationTests Change-Id: I9049dbd8e04786b1aba31badbbd41e67e7daa574 Merged-In: I9049dbd8e04786b1aba31badbbd41e67e7daa574 (cherry picked from e1d73d8950d6909347b8c6a4ac3dca27fb912157)
Diffstat (limited to 'system/common/metrics.cc')
-rw-r--r--system/common/metrics.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/system/common/metrics.cc b/system/common/metrics.cc
index be1d1b3bac..0664186cac 100644
--- a/system/common/metrics.cc
+++ b/system/common/metrics.cc
@@ -859,6 +859,7 @@ void LogSocketConnectionState(
}
void LogManufacturerInfo(const RawAddress& address,
+ android::bluetooth::AddressTypeEnum address_type,
android::bluetooth::DeviceInfoSrcEnum source_type,
const std::string& source_name,
const std::string& manufacturer,
@@ -875,16 +876,20 @@ void LogManufacturerInfo(const RawAddress& address,
BytesField obfuscated_id_field(
address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
address.IsEmpty() ? 0 : obfuscated_id.size());
- int ret = stats_write(BLUETOOTH_DEVICE_INFO_REPORTED, obfuscated_id_field,
- source_type, source_name.c_str(), manufacturer.c_str(),
- model.c_str(), hardware_version.c_str(),
- software_version.c_str(), metric_id);
+ int ret = stats_write(
+ BLUETOOTH_DEVICE_INFO_REPORTED, obfuscated_id_field, source_type,
+ source_name.c_str(), manufacturer.c_str(), model.c_str(),
+ hardware_version.c_str(), software_version.c_str(), metric_id,
+ address_type, address.address[5], address.address[4], address.address[3]);
if (ret < 0) {
LOG(WARNING) << __func__ << ": failed for " << address << ", source_type "
<< source_type << ", source_name " << source_name
<< ", manufacturer " << manufacturer << ", model " << model
<< ", hardware_version " << hardware_version
- << ", software_version " << software_version << ", error "
+ << ", software_version " << software_version
+ << " MAC address type " << address_type
+ << " MAC address prefix " << address.address[5] << " "
+ << address.address[4] << " " << address.address[3] << ", error "
<< ret;
}
}