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

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

Snap for 5694913 from bcb4004b to qt-c2f2-release

Change-Id: I052233ef270ee5f44b8a8796251224df3042bb64
parents 0ba839fa bcb4004b
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -120,6 +120,11 @@ Return<void> BluetoothHci::initialize(const sp<IBluetoothHciCallbacks>& cb) {
  // Add the controller as a device in the model.
  test_model_.Add(controller_);

  // Send responses to logcat if the test channel is not configured.
  test_channel_.RegisterSendResponse([](const std::string& response) {
    ALOGI("No test channel yet: %s", response.c_str());
  });

  if (BtTestConsoleEnabled()) {
    SetUpTestChannel(6111);
    SetUpHciServer(6211,
@@ -128,6 +133,16 @@ Return<void> BluetoothHci::initialize(const sp<IBluetoothHciCallbacks>& cb) {
        6311, [this](int fd) { test_model_.IncomingLinkLayerConnection(fd); });
  }

  // Add some default devices for easier debugging
  test_channel_.AddDefaults();

  // This should be configurable in the future.
  ALOGI("Adding Beacons so the scan list is not empty.");
  test_channel_.Add({"beacon", "be:ac:10:00:00:01", "1000"});
  test_channel_.AddDeviceToPhy({"1", "0"});
  test_channel_.Add({"beacon", "be:ac:10:00:00:02", "1000"});
  test_channel_.AddDeviceToPhy({"2", "0"});

  unlink_cb_ = [cb](sp<BluetoothDeathRecipient>& death_recipient) {
    if (death_recipient->getHasDied())
      ALOGI("Skipping unlink call, service died.");
@@ -261,16 +276,6 @@ void BluetoothHci::SetUpTestChannel(int port) {
  test_channel_.RegisterSendResponse(
      [](const std::string& response) { ALOGI("No test channel: %s", response.c_str()); });

  // Add some default devices for easier debugging
  test_channel_.AddDefaults();

  // This should be configurable in the future.
  ALOGI("Adding Beacons so the scan list is not empty.");
  test_channel_.Add({"beacon", "be:ac:10:00:00:01", "1000"});
  test_channel_.AddDeviceToPhy({"1", "0"});
  test_channel_.Add({"beacon", "be:ac:10:00:00:02", "1000"});
  test_channel_.AddDeviceToPhy({"2", "0"});

  if (socket_fd == -1) {
    ALOGE("Test channel SetUp(%d) failed.", port);
    return;