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

Commit f5ceef3a authored by Henri Chataing's avatar Henri Chataing
Browse files

system: Remove unnecessary calls to std::to_string in fmt arguments

Test: m com.android.btservices
Bug: 305066880
Flag: EXEMPT, mechanical refactor
Change-Id: I21eec4ea124d261d482eebe725420a5314268d73
parent b4d62acf
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ bool CounterMetrics::CacheCount(int32_t key, int64_t count) {
    return false;
  }
  if (count <= 0) {
    log::warn("count is not larger than 0. count: {}, key: {}", std::to_string(count), key);
    log::warn("count is not larger than 0. count: {}, key: {}", count, key);
    return false;
  }
  int64_t total = 0;
@@ -65,11 +65,7 @@ bool CounterMetrics::CacheCount(int32_t key, int64_t count) {
    total = counters_[key];
  }
  if (LLONG_MAX - total < count) {
    log::warn(
        "Counter metric overflows. count {} current total: {} key: {}",
        std::to_string(count),
        std::to_string(total),
        key);
    log::warn("Counter metric overflows. count {} current total: {} key: {}", count, total, key);
    counters_[key] = LLONG_MAX;
    return false;
  }
@@ -83,7 +79,7 @@ bool CounterMetrics::Count(int32_t key, int64_t count) {
    return false;
  }
  if (count <= 0) {
    log::warn("count is not larger than 0. count: {}, key: {}", std::to_string(count), key);
    log::warn("count is not larger than 0. count: {}, key: {}", count, key);
    return false;
  }
  os::LogMetricBluetoothCodePathCounterMetrics(key, count);
+8 −8
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ void LogMetricA2dpAudioUnderrunEvent(
    log::warn(
        "Failed for {}, encoding_interval_nanos {}, num_missing_pcm_bytes {}, error {}",
        address,
        std::to_string(encoding_interval_nanos),
        encoding_interval_nanos,
        num_missing_pcm_bytes,
        ret);
  }
@@ -170,7 +170,7 @@ void LogMetricA2dpAudioOverrunEvent(
        "Failed to log for {}, encoding_interval_nanos {}, num_dropped_buffers {}, "
        "num_dropped_encoded_frames {}, num_dropped_encoded_bytes {}, error {}",
        address,
        std::to_string(encoding_interval_nanos),
        encoding_interval_nanos,
        num_dropped_buffers,
        num_dropped_encoded_frames,
        num_dropped_encoded_bytes,
@@ -332,7 +332,7 @@ void LogMetricClassicPairingEvent(
        common::ToHexString(hci_event),
        common::ToHexString(cmd_status),
        common::ToHexString(reason_code),
        std::to_string(event_value),
        event_value,
        ret);
  }

@@ -398,8 +398,8 @@ void LogMetricSocketConnectionState(
        port,
        type,
        connection_state,
        std::to_string(tx_bytes),
        std::to_string(rx_bytes),
        tx_bytes,
        rx_bytes,
        uid,
        server_port,
        socket_role,
@@ -477,7 +477,7 @@ void LogMetricBluetoothLocalSupportedFeatures(uint32_t page_num, uint64_t featur
    log::warn(
        "Failed for LogMetricBluetoothLocalSupportedFeatures, page_num {}, features {}, error {}",
        page_num,
        std::to_string(features),
        features,
        ret);
  }
}
@@ -544,7 +544,7 @@ void LogMetricBluetoothRemoteSupportedFeatures(
        "connection_handle {}, error {}",
        metric_id,
        page,
        std::to_string(features),
        features,
        connection_handle,
        ret);
  }
@@ -553,7 +553,7 @@ void LogMetricBluetoothRemoteSupportedFeatures(
void LogMetricBluetoothCodePathCounterMetrics(int32_t key, int64_t count) {
  int ret = stats_write(BLUETOOTH_CODE_PATH_COUNTER, key, count);
  if (ret < 0) {
    log::warn("Failed counter metrics for {}, count {}, error {}", key, std::to_string(count), ret);
    log::warn("Failed counter metrics for {}, count {}, error {}", key, count, ret);
  }
}

+1 −1
Original line number Diff line number Diff line
@@ -1034,7 +1034,7 @@ bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority) {
 *
 ******************************************************************************/
bool L2CA_SetAclLatency(const RawAddress& bd_addr, tL2CAP_LATENCY latency) {
  log::info("BDA: {}, latency: {}", bd_addr, std::to_string(latency));
  log::info("BDA: {}, latency: {}", bd_addr, latency);
  return l2cu_set_acl_latency(bd_addr, latency);
}