Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c57260c7 authored by Chen Chen's avatar Chen Chen Committed by Gerrit Code Review
Browse files

Merge "BluetoothMetrics: Remove MetricIdAllocator reference from HalCrashReason"

parents 0d07ecb0 de347097
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -904,17 +904,15 @@ void LogManufacturerInfo(const RawAddress& address,
void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code,
                                uint32_t vendor_error_code) {
  std::string obfuscated_id;
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  android::util::BytesField obfuscated_id_field(
      address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
      address.IsEmpty() ? 0 : obfuscated_id.size());
  int ret = android::util::stats_write(
      android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, metric_id,
      android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, 0,
      obfuscated_id_field, error_code, vendor_error_code);
  if (ret < 0) {
    LOG(WARNING) << __func__ << ": failed for " << address << ", error_code "