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

Commit a8de6080 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "24Q4: Removal of device_iot_config_logging" into main am: f17bb749 am: b3c22dd0

parents 0a182bd2 b3c22dd0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ aconfig_declarations {
        "btif_dm.aconfig",
        "btm_ble.aconfig",
        "connectivity.aconfig",
        "device_iot_config.aconfig",
        "dis.aconfig",
        "framework.aconfig",
        "gap.aconfig",
+0 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ aconfig("bluetooth_flags_c_lib") {
    "btif_dm.aconfig",
    "btm_ble.aconfig",
    "connectivity.aconfig",
    "device_iot_config.aconfig",
    "dis.aconfig",
    "framework.aconfig",
    "gap.aconfig",

flags/device_iot_config.aconfig

deleted100644 → 0
+0 −9
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.bt"

flag {
    name: "device_iot_config_logging"
    namespace: "bluetooth"
    description: "Enable device IOT information storage."
    bug: "290844229"
}
+0 −3
Original line number Diff line number Diff line
@@ -95,17 +95,14 @@ cc_test {
        "liblog",
    ],
    static_libs: [
        "bluetooth_flags_c_lib",
        "libbluetooth-types",
        "libbluetooth_log",
        "libbt-platform-protos-lite",
        "libbtcore",
        "libbtdevice",
        "libchrome",
        "libflagtest",
        "libgmock",
        "libosi",
        "server_configurable_flags",
    ],
    header_libs: ["libbluetooth_headers"],
}
+0 −69
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include "device/include/device_iot_config.h"

#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
@@ -49,10 +48,6 @@ alarm_t* config_timer;
using namespace bluetooth;

bool device_iot_config_has_section(const std::string& section) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -60,10 +55,6 @@ bool device_iot_config_has_section(const std::string& section) {
}

bool device_iot_config_exist(const std::string& section, const std::string& key) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -71,10 +62,6 @@ bool device_iot_config_exist(const std::string& section, const std::string& key)
}

bool device_iot_config_get_int(const std::string& section, const std::string& key, int& value) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -87,10 +74,6 @@ bool device_iot_config_get_int(const std::string& section, const std::string& ke
}

bool device_iot_config_set_int(const std::string& section, const std::string& key, int value) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -107,10 +90,6 @@ bool device_iot_config_set_int(const std::string& section, const std::string& ke
}

bool device_iot_config_int_add_one(const std::string& section, const std::string& key) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  int result = 0;
@@ -128,10 +107,6 @@ bool device_iot_config_int_add_one(const std::string& section, const std::string
}

bool device_iot_config_get_hex(const std::string& section, const std::string& key, int& value) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -159,10 +134,6 @@ bool device_iot_config_get_hex(const std::string& section, const std::string& ke

bool device_iot_config_set_hex(const std::string& section, const std::string& key, int value,
                               int byte_num) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  char value_str[32] = {0};
@@ -189,10 +160,6 @@ bool device_iot_config_set_hex(const std::string& section, const std::string& ke

bool device_iot_config_set_hex_if_greater(const std::string& section, const std::string& key,
                                          int value, int byte_num) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  int stored_value = 0;
  bool ret = device_iot_config_get_hex(section, key, stored_value);
  if (ret && stored_value >= value) {
@@ -204,10 +171,6 @@ bool device_iot_config_set_hex_if_greater(const std::string& section, const std:

bool device_iot_config_get_str(const std::string& section, const std::string& key, char* value,
                               int* size_bytes) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");
  log::assert_that(value != NULL, "assert failed: value != NULL");
  log::assert_that(size_bytes != NULL, "assert failed: size_bytes != NULL");
@@ -227,10 +190,6 @@ bool device_iot_config_get_str(const std::string& section, const std::string& ke

bool device_iot_config_set_str(const std::string& section, const std::string& key,
                               const std::string& value) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -246,10 +205,6 @@ bool device_iot_config_set_str(const std::string& section, const std::string& ke

bool device_iot_config_get_bin(const std::string& section, const std::string& key, uint8_t* value,
                               size_t* length) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");
  log::assert_that(value != NULL, "assert failed: value != NULL");
  log::assert_that(length != NULL, "assert failed: length != NULL");
@@ -293,10 +248,6 @@ bool device_iot_config_get_bin(const std::string& section, const std::string& ke
}

size_t device_iot_config_get_bin_length(const std::string& section, const std::string& key) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return 0;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -312,10 +263,6 @@ size_t device_iot_config_get_bin_length(const std::string& section, const std::s

bool device_iot_config_set_bin(const std::string& section, const std::string& key,
                               const uint8_t* value, size_t length) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  const char* lookup = "0123456789abcdef";

  log::assert_that(config != NULL, "assert failed: config != NULL");
@@ -350,10 +297,6 @@ bool device_iot_config_set_bin(const std::string& section, const std::string& ke
}

bool device_iot_config_remove(const std::string& section, const std::string& key) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return false;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");

  std::unique_lock<std::mutex> lock(config_lock);
@@ -361,10 +304,6 @@ bool device_iot_config_remove(const std::string& section, const std::string& key
}

void device_iot_config_flush(void) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");
  log::assert_that(config_timer != NULL, "assert failed: config_timer != NULL");

@@ -376,10 +315,6 @@ void device_iot_config_flush(void) {
}

bool device_iot_config_clear(void) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return true;
  }

  log::assert_that(config != NULL, "assert failed: config != NULL");
  log::assert_that(config_timer != NULL, "assert failed: config_timer != NULL");

@@ -400,10 +335,6 @@ bool device_iot_config_clear(void) {
}

void device_debug_iot_config_dump(int fd) {
  if (!com::android::bluetooth::flags::device_iot_config_logging()) {
    return;
  }

  dprintf(fd, "\nBluetooth Iot Config:\n");

  dprintf(fd, "  Config Source: ");
Loading