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

Commit 21aa5d75 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7227300 from ae79ada9 to sc-release

Change-Id: I048af680e8edef46cd7f56aa938749a9fe0b6bd9
parents d82ac624 ae79ada9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ cc_binary_host {
        "libscriptedbeaconpayload-protos-lite",
        "libbt-rootcanal",
        "breakpad_client",
        "libgflags",
    ],
    sanitize: {
        address: true,
+5 −0
Original line number Diff line number Diff line
prebuilt_etc_host {
    name: "controller_properties.json",
    src: "controller_properties.json",
    sub_dir: "rootcanal/data",
}
 No newline at end of file
+12 −1
Original line number Diff line number Diff line
@@ -23,10 +23,17 @@
#include <backtrace/Backtrace.h>
#include <backtrace/backtrace_constants.h>

#include <gflags/gflags.h>

#include "os/log.h"

using ::android::bluetooth::root_canal::TestEnvironment;

DEFINE_string(controller_properties_file, "",
              "controller_properties.json file path");
DEFINE_string(default_commands_file, "",
              "commands file which root-canal runs it as default");

constexpr uint16_t kTestPort = 6401;
constexpr uint16_t kHciServerPort = 6402;
constexpr uint16_t kLinkServerPort = 6403;
@@ -74,6 +81,8 @@ int main(int argc, char** argv) {
                                       true, -1);
  eh.set_crash_handler(crash_callback);

  gflags::ParseCommandLineFlags(&argc, &argv, true);

  LOG_INFO("main");
  uint16_t test_port = kTestPort;
  uint16_t hci_server_port = kHciServerPort;
@@ -103,7 +112,9 @@ int main(int argc, char** argv) {
    }
  }

  TestEnvironment root_canal(test_port, hci_server_port, link_server_port);
  TestEnvironment root_canal(test_port, hci_server_port, link_server_port,
                             FLAGS_controller_properties_file,
                             FLAGS_default_commands_file);
  std::promise<void> barrier;
  std::future<void> barrier_future = barrier.get_future();
  root_canal.initialize(std::move(barrier));
+2 −0
Original line number Diff line number Diff line
@@ -159,6 +159,8 @@ void TestEnvironment::SetUpTestChannel() {
  test_channel_.SetTimerPeriod({"5"});
  test_channel_.StartTimer({});

  test_channel_.FromFile(default_commands_file_);

  if (socket_fd == -1) {
    LOG_ERROR("Test channel SetUp(%d) failed.", test_port_);
    return;
+11 −2
Original line number Diff line number Diff line
@@ -30,8 +30,16 @@ namespace root_canal {

class TestEnvironment {
 public:
  TestEnvironment(uint16_t test_port, uint16_t hci_server_port, uint16_t link_server_port)
      : test_port_(test_port), hci_server_port_(hci_server_port), link_server_port_(link_server_port) {}
  TestEnvironment(uint16_t test_port, uint16_t hci_server_port,
                  uint16_t link_server_port,
                  const std::string& controller_properties_file = "",
                  const std::string& default_commands_file = "")
      : test_port_(test_port),
        hci_server_port_(hci_server_port),
        link_server_port_(link_server_port),
        default_commands_file_(default_commands_file),
        controller_(std::make_shared<test_vendor_lib::DualModeController>(
            controller_properties_file)) {}

  void initialize(std::promise<void> barrier);

@@ -41,6 +49,7 @@ class TestEnvironment {
  uint16_t test_port_;
  uint16_t hci_server_port_;
  uint16_t link_server_port_;
  std::string default_commands_file_;
  std::promise<void> barrier_;

  test_vendor_lib::AsyncManager async_manager_;
Loading