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

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

system/gd: Migrate to libbluetooth_log

Test: m com.android.btservices
Bug: 305066880
Flag: EXEMPT, mechanical refactor
Change-Id: Icf3f204d9e96ea948154b083757e5ec952bca0ff
parent 81cf07a8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ source_set("libbt-audio-asrc") {

  configs += [
    "//bt/system:target_defaults",
    "//bt/system/log:log_defaults",
  ]

  deps = [
+4 −2
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@

#include "att/att_module.h"

#include <bluetooth/log.h>

#include <memory>

#include "l2cap/classic/l2cap_classic_module.h"
@@ -35,11 +37,11 @@ namespace {
void OnAttRegistrationCompleteLe(
    l2cap::le::FixedChannelManager::RegistrationResult /* result */,
    std::unique_ptr<l2cap::le::FixedChannelService> /* le_smp_service */) {
  LOG_INFO("ATT channel registration complete");
  log::info("ATT channel registration complete");
}

void OnAttConnectionOpenLe(std::unique_ptr<l2cap::le::FixedChannel> /* channel */) {
  LOG_INFO("ATT conneciton opened");
  log::info("ATT conneciton opened");
}
}  // namespace

+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#include "discovery/device/data_parser.h"

#include <bluetooth/log.h>

#include <algorithm>

#include "gtest/gtest.h"
@@ -261,7 +263,7 @@ TEST(DataParserTest, random) {
    DataParser data_parser(data);

    if (((i + 1) % 100) == 0) {
      LOG_INFO("loop %d", i);
      bluetooth::log::info("loop {}", i);
    }
  }
}
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#include "discovery/device/eir_data.h"

#include <bluetooth/log.h>

#include "discovery/device/eir_test_data_packets.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@@ -38,13 +40,13 @@ constexpr char kChromeBoxForMeetings[] = "Chromebox for Meetings";
namespace debug {
void LogUuids16(const std::vector<uint16_t>& uuids16) {
  for (const auto& uuid : uuids16) {
    LOG_INFO("  uuid:0x%x", uuid);
    log::info("uuid:0x{:x}", uuid);
  }
}

void LogUuids128(const std::vector<hci::Uuid>& uuids128) {
  for (const auto& uuid : uuids128) {
    LOG_INFO("  uuid:%s", uuid.ToString().c_str());
    log::info("uuid:{}", uuid.ToString());
  }
}
}  // namespace debug
+7 −5
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#include "dumpsys/filter.h"

#include <bluetooth/log.h>

#include <memory>

#include "common/init_flags.h"
@@ -123,7 +125,7 @@ bool UserPrivacyFilter::FilterField(const reflection::Field* field, flatbuffers:
      return internal::FilterTypeLong(*field, table, privacy_level);
      break;
    default:
      LOG_WARN("Unsupported base type:%s", internal::FlatbufferTypeText(type).c_str());
      log::warn("Unsupported base type:{}", internal::FlatbufferTypeText(type));
      break;
  }
  return false;
@@ -136,20 +138,20 @@ void UserPrivacyFilter::FilterObject(const reflection::Object* object, flatbuffe
  }
  for (auto it = object->fields()->cbegin(); it != object->fields()->cend(); ++it) {
    if (!FilterField(*it, table)) {
      LOG_ERROR("%s Unable to filter field from an object when it's expected it will work", __func__);
      log::error("Unable to filter field from an object when it's expected it will work");
    };
  }
}

void UserPrivacyFilter::FilterTable(const reflection::Schema* schema, flatbuffers::Table* table) {
  if (schema == nullptr) {
    LOG_WARN("%s schema is nullptr...probably ok", __func__);
    log::warn("schema is nullptr...probably ok");
    return;
  }

  const reflection::Object* object = schema->root_table();
  if (object == nullptr) {
    LOG_WARN("%s reflection object is nullptr...is ok ?", __func__);
    log::warn("reflection object is nullptr...is ok ?");
    return;
  }

@@ -179,7 +181,7 @@ void UserPrivacyFilter::FilterTable(const reflection::Schema* schema, flatbuffer
      if (sub_object != nullptr) {
        FilterObject(sub_object, sub_table);
      } else {
        LOG_ERROR("Unable to find reflection sub object:%s\n", name->c_str());
        log::error("Unable to find reflection sub object:{}", name->c_str());
      }
    }
  }
Loading