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

Commit 129e388a authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Abhishek Pandit-Subedi
Browse files

Move all config files to /var/lib/bluetooth

For floss, move all config files to /var/lib/bluetooth.

Bug: 189490070
Tag: #floss
Test: atest --host bluetooth_test_gd

Change-Id: Id93bc848420cbc6f111988a53509574ef0c08778
parent ced2a66a
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,11 @@ using bluetooth::common::AddressObfuscator;
using bluetooth::common::MetricIdAllocator;
using bluetooth::common::MetricIdAllocator;


// TODO(armansito): Find a better way than searching by a hardcoded path.
// TODO(armansito): Find a better way than searching by a hardcoded path.
#if defined(OS_GENERIC)
#if defined(TARGET_FLOSS)
static const char* CONFIG_FILE_PATH = "/var/lib/bluetooth/bt_config.conf";
static const char* CONFIG_BACKUP_PATH = "/var/lib/bluetooth/bt_config.bak";
static const char* CONFIG_LEGACY_FILE_PATH = "/var/lib/bluetooth/bt_config.xml";
#elif defined(OS_GENERIC)
static const char* CONFIG_FILE_PATH = "bt_config.conf";
static const char* CONFIG_FILE_PATH = "bt_config.conf";
static const char* CONFIG_BACKUP_PATH = "bt_config.bak";
static const char* CONFIG_BACKUP_PATH = "bt_config.bak";
static const char* CONFIG_LEGACY_FILE_PATH = "bt_config.xml";
static const char* CONFIG_LEGACY_FILE_PATH = "bt_config.xml";
+3 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,9 @@ static void bt_jni_msg_ready(void* context);


#ifndef BTE_DID_CONF_FILE
#ifndef BTE_DID_CONF_FILE
// TODO(armansito): Find a better way than searching by a hardcoded path.
// TODO(armansito): Find a better way than searching by a hardcoded path.
#if defined(OS_GENERIC) && !defined(TARGET_FLOSS)
#if defined(TARGET_FLOSS)
#define BTE_DID_CONF_FILE "/var/lib/bluetooth/bt_did.conf"
#elif defined(OS_GENERIC)
#define BTE_DID_CONF_FILE "bt_did.conf"
#define BTE_DID_CONF_FILE "bt_did.conf"
#else  // !defined(OS_GENERIC)
#else  // !defined(OS_GENERIC)
#define BTE_DID_CONF_FILE "/etc/bluetooth/bt_did.conf"
#define BTE_DID_CONF_FILE "/etc/bluetooth/bt_did.conf"
+1 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@ config("gd_defaults") {
  defines = [
  defines = [
    "OS_LINUX_GENERIC",
    "OS_LINUX_GENERIC",
    "OS_GENERIC",
    "OS_GENERIC",
    "TARGET_FLOSS",
  ]
  ]


  libs = [
  libs = [
+3 −3
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@ std::string ParameterProvider::ConfigFilePath() {
      return config_file_path;
      return config_file_path;
    }
    }
  }
  }
  return "/etc/bluetooth/bt_config.conf";
  return "/var/lib/bluetooth/bt_config.conf";
}
}


void ParameterProvider::OverrideConfigFilePath(const std::string& path) {
void ParameterProvider::OverrideConfigFilePath(const std::string& path) {
@@ -58,7 +58,7 @@ std::string ParameterProvider::SnoopLogFilePath() {
    }
    }
  }
  }


  return "/etc/bluetooth/btsnoop_hci.log";
  return "/var/log/bluetooth/btsnoop_hci.log";
}
}


void ParameterProvider::OverrideSnoopLogFilePath(const std::string& path) {
void ParameterProvider::OverrideSnoopLogFilePath(const std::string& path) {
@@ -73,7 +73,7 @@ std::string ParameterProvider::SnoozLogFilePath() {
      return snooz_log_file_path;
      return snooz_log_file_path;
    }
    }
  }
  }
  return "/etc/bluetooth/btsnooz_hci.log";
  return "/var/log/bluetooth/btsnooz_hci.log";
}
}


}  // namespace os
}  // namespace os
+3 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,9 @@ static std::unique_ptr<config_t> config;


static future_t* init() {
static future_t* init() {
// TODO(armansito): Find a better way than searching by a hardcoded path.
// TODO(armansito): Find a better way than searching by a hardcoded path.
#if defined(OS_GENERIC) && !defined(TARGET_FLOSS)
#if defined(TARGET_FLOSS)
  const char* path = "/var/lib/bluetooth/bt_stack.conf";
#elif defined(OS_GENERIC)
  const char* path = "bt_stack.conf";
  const char* path = "bt_stack.conf";
#else  // !defined(OS_GENERIC)
#else  // !defined(OS_GENERIC)
  const char* path = "/etc/bluetooth/bt_stack.conf";
  const char* path = "/etc/bluetooth/bt_stack.conf";