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

Commit e4cd51b4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Metrics: Dump native metrics to Java as std:string"

parents ad4dc5e5 d20346ab
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -303,13 +303,6 @@ static int read_energy_info() {
}

static void dump(int fd, const char** arguments) {
  if (arguments != NULL && arguments[0] != NULL) {
    if (strncmp(arguments[0], "--proto-bin", 11) == 0) {
      system_bt_osi::BluetoothMetricsLogger::GetInstance()->WriteBase64(fd,
                                                                        true);
      return;
    }
  }
  btif_debug_conn_dump(fd);
  btif_debug_bond_event_dump(fd);
  btif_debug_a2dp_dump(fd);
@@ -328,6 +321,11 @@ static void dump(int fd, const char** arguments) {
  close(fd);
}

static void dumpMetrics(std::string* output) {
  system_bt_osi::BluetoothMetricsLogger::GetInstance()->WriteString(output,
                                                                    true);
}

static const void* get_profile_interface(const char* profile_id) {
  LOG_INFO(LOG_TAG, "%s: id = %s", __func__, profile_id);

@@ -447,6 +445,7 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    set_os_callouts,
    read_energy_info,
    dump,
    dumpMetrics,
    config_clear,
    interop_database_clear,
    interop_database_add,
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ bool interop_match_name(const interop_feature_t feature, const char* name);
// |length| must be greater than 0 and less than RawAddress::kLength.
// As |interop_feature_t| is not exposed in the public API, feature must be a
// valid integer representing an option in the enum.
void interop_database_add(const uint16_t feature, const RawAddress* addr,
void interop_database_add(uint16_t feature, const RawAddress* addr,
                          size_t length);

// Clear the dynamic portion of the interoperability workaround database.
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ bool interop_match_name(const interop_feature_t feature, const char* name) {
  return false;
}

void interop_database_add(const uint16_t feature, const RawAddress* addr,
void interop_database_add(uint16_t feature, const RawAddress* addr,
                          size_t length) {
  CHECK(addr);
  CHECK(length > 0);
+8 −0
Original line number Diff line number Diff line
@@ -558,6 +558,14 @@ typedef struct {
   */
  void (*dump)(int fd, const char** arguments);

  /**
   * Native support for metrics protobuf dumping. The dumping format will be
   * raw byte array
   *
   * @param output an externally allocated string to dump serialized protobuf
   */
  void (*dumpMetrics)(std::string* output);

  /**
   * Clear /data/misc/bt_config.conf and erase all stored connections
   */
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ bt_interface_t fake_bt_iface = {
    nullptr, /* set_os_callouts */
    nullptr, /* read_energy_info */
    nullptr, /* dump */
    nullptr, /* dumpMetrics */
    nullptr, /* config clear */
    nullptr, /* interop_database_clear */
    nullptr  /* interop_database_add */