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

Commit 15e21745 authored by Henri Chataing's avatar Henri Chataing
Browse files

Remove debug function btif_debug_config_dump

The dumped information is not up-to-date

Bug: 331817295
Test: m com.android.btservices
Flag: EXEMPT, dead code removal
Change-Id: Id48043d31c5afde0b35e159743ec768aa84cda1c
parent a54d63e2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -58,6 +58,5 @@ size_t btif_config_get_bin_length(const std::string& section,
std::vector<RawAddress> btif_config_get_paired_devices();

bool btif_config_clear(void);
void btif_debug_config_dump(int fd);
bool btif_get_device_clockoffset(const RawAddress& bda, int* p_clock_offset);
bool btif_set_device_clockoffset(const RawAddress& bda, int clock_offset);
+0 −1
Original line number Diff line number Diff line
@@ -824,7 +824,6 @@ static void dump(int fd, const char** arguments) {
  stack_debug_avdtp_api_dump(fd);
  btif_sock_dump(fd);
  bluetooth::avrcp::AvrcpService::DebugDump(fd);
  btif_debug_config_dump(fd);
  gatt_tcb_dump(fd);
  bta_gatt_client_dump(fd);
  device_debug_iot_config_dump(fd);
+0 −52
Original line number Diff line number Diff line
@@ -65,17 +65,6 @@ static const std::string encrypt_key_name_list[] = {
    "LinkKey",      "LE_KEY_PENC", "LE_KEY_PID",  "LE_KEY_LID",
    "LE_KEY_PCSRK", "LE_KEY_LENC", "LE_KEY_LCSRK"};

static enum ConfigSource {
  NOT_LOADED,
  ORIGINAL,
  BACKUP,
  LEGACY,
  NEW_FILE,
  RESET
} btif_config_source = NOT_LOADED;

static char btif_config_time_created[TIME_STRING_LENGTH];

/**
 * Read metrics salt from config file, if salt is invalid or does not exist,
 * generate new one and save it to config
@@ -337,44 +326,3 @@ bool btif_config_clear(void) {
  bluetooth::shim::BtifConfigInterface::Clear();
  return true;
}

void btif_debug_config_dump(int fd) {
  dprintf(fd, "\nBluetooth Config:\n");

  dprintf(fd, "  Config Source: ");
  switch (btif_config_source) {
    case NOT_LOADED:
      dprintf(fd, "Not loaded\n");
      break;
    case ORIGINAL:
      dprintf(fd, "Original file\n");
      break;
    case BACKUP:
      dprintf(fd, "Backup file\n");
      break;
    case LEGACY:
      dprintf(fd, "Legacy file\n");
      break;
    case NEW_FILE:
      dprintf(fd, "New file\n");
      break;
    case RESET:
      dprintf(fd, "Reset file\n");
      break;
  }

  std::optional<std::string> file_source;
  if (bluetooth::shim::is_gd_stack_started_up()) {
    file_source =
        bluetooth::shim::BtifConfigInterface::GetStr(INFO_SECTION, FILE_SOURCE);
  } else {
    file_source = btif_config_cache.GetString(INFO_SECTION, FILE_SOURCE);
  }
  if (!file_source) {
    file_source.emplace("Original");
  }
  auto devices = btif_config_cache.GetPersistentSectionNames();
  dprintf(fd, "  Devices loaded: %zu\n", devices.size());
  dprintf(fd, "  File created/tagged: %s\n", btif_config_time_created);
  dprintf(fd, "  File source: %s\n", file_source->c_str());
}
+0 −5
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@ struct btif_config_get_paired_devices btif_config_get_paired_devices;
struct btif_config_remove btif_config_remove;
struct btif_config_remove_device btif_config_remove_device;
struct btif_config_clear btif_config_clear;
struct btif_debug_config_dump btif_debug_config_dump;

}  // namespace btif_config
}  // namespace mock
@@ -133,9 +132,5 @@ bool btif_config_clear(void) {
  inc_func_call_count(__func__);
  return test::mock::btif_config::btif_config_clear();
}
void btif_debug_config_dump(int fd) {
  inc_func_call_count(__func__);
  test::mock::btif_config::btif_debug_config_dump(fd);
}

// END mockcify generation
+0 −8
Original line number Diff line number Diff line
@@ -240,14 +240,6 @@ struct btif_config_clear {
  bool operator()(void) { return body(); };
};
extern struct btif_config_clear btif_config_clear;
// Name: btif_debug_config_dump
// Params: int fd
// Returns: void
struct btif_debug_config_dump {
  std::function<void(int fd)> body{[](int /* fd */) {}};
  void operator()(int fd) { body(fd); };
};
extern struct btif_debug_config_dump btif_debug_config_dump;

}  // namespace btif_config
}  // namespace mock