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

Commit 3b2c1c12 authored by Palash Ahuja's avatar Palash Ahuja Committed by Gerrit Code Review
Browse files

Merge "BluetoothMetrics: Reuse metric id allocator from...

Merge "BluetoothMetrics: Reuse metric id allocator from system/gd/common/metric_id_manager.cc" into main
parents 7ddc68bc c1ef56c6
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -551,7 +551,7 @@ void LogLinkLayerConnectionEvent(const RawAddress* address, uint32_t connection_
  int metric_id = 0;
  if (address != nullptr) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(*address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(*address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(*address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address != nullptr ? obfuscated_id.c_str() : nullptr,
@@ -593,7 +593,7 @@ void LogA2dpAudioUnderrunEvent(const RawAddress& address, uint64_t encoding_inte
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -616,7 +616,7 @@ void LogA2dpAudioOverrunEvent(const RawAddress& address, uint64_t encoding_inter
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -640,7 +640,7 @@ void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state, int aud
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -661,7 +661,7 @@ void LogReadRssiResult(const RawAddress& address, uint16_t handle, uint32_t cmd_
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -680,7 +680,7 @@ void LogReadFailedContactCounterResult(const RawAddress& address, uint16_t handl
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -701,7 +701,7 @@ void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle, uint3
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField bytes_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -722,7 +722,7 @@ void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd,
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField obfuscated_id_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -744,7 +744,7 @@ void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField obfuscated_id_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -765,7 +765,7 @@ void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid, uint16_t
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField obfuscated_id_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -787,7 +787,7 @@ void LogSocketConnectionState(const RawAddress& address, int port, int type,
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField obfuscated_id_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),
@@ -814,7 +814,7 @@ void LogManufacturerInfo(const RawAddress& address,
  int metric_id = 0;
  if (!address.IsEmpty()) {
    obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address);
    metric_id = MetricIdAllocator::GetInstance().AllocateId(address);
    metric_id = bluetooth::shim::AllocateIdFromMetricIdAllocator(address);
  }
  // nullptr and size 0 represent missing value for obfuscated_id
  BytesField obfuscated_id_field(address.IsEmpty() ? nullptr : obfuscated_id.c_str(),