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

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

system: Replace loghex by {:x} in log calls

Other cleanup changes applied based on existing
passes in the cleanup script used

Test: m com.android.btservices
Bug: 305066880
Flag: EXEMPT, mechanical refactor
Change-Id: Ie8daf0e6723f4e4deffaa4c00c1c3cb01b594662
parent 8aa0bf95
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -307,9 +307,8 @@ static void device_found_callback(int num_properties,
    return;
  }

  log::verbose(
      "Properties: {}, Address: {}", num_properties,
      ADDRESS_TO_LOGGABLE_STR(*(RawAddress*)properties[addr_index].val));
  log::verbose("Properties: {}, Address: {}", num_properties,
               *(RawAddress*)properties[addr_index].val);

  remote_device_properties_callback(BT_STATUS_SUCCESS,
                                    (RawAddress*)properties[addr_index].val,
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ class HearingAidCallbacksImpl : public HearingAidCallbacks {

  void OnDeviceAvailable(uint8_t capabilities, uint64_t hi_sync_id,
                         const RawAddress& bd_addr) override {
    log::info("capabilities={} hi_sync_id={}", +capabilities, hi_sync_id);
    log::info("capabilities={} hi_sync_id={}", capabilities, hi_sync_id);

    std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex);
    CallbackEnv sCallbackEnv(__func__);
+6 −6
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class JniHeadsetCallbacks : bluetooth::headset::Callbacks {
  void ConnectionStateCallback(
      bluetooth::headset::bthf_connection_state_t state,
      RawAddress* bd_addr) override {
    log::info("{} for {}", state, ADDRESS_TO_LOGGABLE_CSTR(*bd_addr));
    log::info("{} for {}", state, *bd_addr);

    std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex);
    CallbackEnv sCallbackEnv(__func__);
@@ -95,7 +95,7 @@ class JniHeadsetCallbacks : bluetooth::headset::Callbacks {

  void AudioStateCallback(bluetooth::headset::bthf_audio_state_t state,
                          RawAddress* bd_addr) override {
    log::info("{} for {}", state, ADDRESS_TO_LOGGABLE_CSTR(*bd_addr));
    log::info("{} for {}", state, *bd_addr);

    std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex);
    CallbackEnv sCallbackEnv(__func__);
@@ -503,7 +503,7 @@ static jboolean connectHfpNative(JNIEnv* env, jobject /* object */,
    jniThrowIOException(env, EINVAL);
    return JNI_FALSE;
  }
  log::info("device {}", ADDRESS_TO_LOGGABLE_CSTR(*((RawAddress*)addr)));
  log::info("device {}", *((RawAddress*)addr));
  bt_status_t status = sBluetoothHfpInterface->Connect((RawAddress*)addr);
  if (status != BT_STATUS_SUCCESS) {
    log::error("Failed HF connection, status: {}", bt_status_text(status));
@@ -525,7 +525,7 @@ static jboolean disconnectHfpNative(JNIEnv* env, jobject /* object */,
    jniThrowIOException(env, EINVAL);
    return JNI_FALSE;
  }
  log::info("device {}", ADDRESS_TO_LOGGABLE_CSTR(*((RawAddress*)addr)));
  log::info("device {}", *((RawAddress*)addr));
  bt_status_t status = sBluetoothHfpInterface->Disconnect((RawAddress*)addr);
  if (status != BT_STATUS_SUCCESS) {
    log::error("Failed HF disconnection, status: {}", bt_status_text(status));
@@ -547,7 +547,7 @@ static jboolean connectAudioNative(JNIEnv* env, jobject /* object */,
    jniThrowIOException(env, EINVAL);
    return JNI_FALSE;
  }
  log::info("device {}", ADDRESS_TO_LOGGABLE_CSTR(*((RawAddress*)addr)));
  log::info("device {}", *((RawAddress*)addr));
  bt_status_t status =
      sBluetoothHfpInterface->ConnectAudio((RawAddress*)addr, 0);
  if (status != BT_STATUS_SUCCESS) {
@@ -571,7 +571,7 @@ static jboolean disconnectAudioNative(JNIEnv* env, jobject /* object */,
    jniThrowIOException(env, EINVAL);
    return JNI_FALSE;
  }
  log::info("device {}", ADDRESS_TO_LOGGABLE_CSTR(*((RawAddress*)addr)));
  log::info("device {}", *((RawAddress*)addr));
  bt_status_t status =
      sBluetoothHfpInterface->DisconnectAudio((RawAddress*)addr);
  if (status != BT_STATUS_SUCCESS) {
+1 −1
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ static void callsetup_cb(const RawAddress* bd_addr,
  ScopedLocalRef<jbyteArray> addr(sCallbackEnv.get(), marshall_bda(bd_addr));
  if (!addr.get()) return;

  log::debug("callsetup_cb bdaddr {}", ADDRESS_TO_LOGGABLE_STR(*bd_addr));
  log::debug("callsetup_cb bdaddr {}", *bd_addr);

  sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onCallSetup,
                               (jint)callsetup, addr.get());
+2 −3
Original line number Diff line number Diff line
@@ -267,9 +267,8 @@ void bta_ag_start_servers(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK services) {
        /* TODO: CR#137125 to handle to error properly */
        log::error(
            "RFCOMM_CreateConnectionWithSecurity ERROR {}, p_scb={}, "
            "services={}, mgmt_cback_index={}",
            status, fmt::ptr(p_scb), loghex(services),
            management_callback_index);
            "services=0x{:x}, mgmt_cback_index={}",
            status, fmt::ptr(p_scb), services, management_callback_index);
      }
      log::verbose("p_scb=0x{}, services=0x{:04x}, mgmt_cback_index={}",
                   fmt::ptr(p_scb), services, management_callback_index);
Loading