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

Commit effd28bd authored by Jorge Moreira Broche's avatar Jorge Moreira Broche Committed by android-build-merger
Browse files

Merge "Allow to disable the rootcanal test console with a property"

am: 5cbf0658

Change-Id: Id29f2fbec572e3cbab7273a8223caf7394414add
parents eed0bca8 5cbf0658
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "bluetooth_hci.h"

#include <base/logging.h>
#include <cutils/properties.h>
#include <string.h>
#include <utils/Log.h>

@@ -44,6 +45,15 @@ using test_vendor_lib::ScoPacket;
using test_vendor_lib::TaskCallback;
using test_vendor_lib::TestChannelTransport;

namespace {

bool BtTestConsoleEnabled() {
  // Assume enabled by default.
  return property_get_bool("bt.rootcanal_test_console", true);
}

}  // namespace

class BluetoothDeathRecipient : public hidl_death_recipient {
 public:
  BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {}
@@ -130,7 +140,9 @@ Return<void> BluetoothHci::initialize(const sp<IBluetoothHciCallbacks>& cb) {
  controller_.RegisterTaskCancel(
      [this](AsyncTaskId task) { async_manager_.CancelAsyncTask(task); });

  if (BtTestConsoleEnabled()) {
    SetUpTestChannel(6111);
  }

  unlink_cb_ = [cb](sp<BluetoothDeathRecipient>& death_recipient) {
    if (death_recipient->getHasDied())