summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-29 23:09:50 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-29 23:09:50 +0000
commit87103690db63b90641fcc4c33c67df3be61404cd (patch)
treedf49b7a0da4f7e956caf12493fbb11c447390116
parentde3669987b00a074d3093affca924de8d51b14e6 (diff)
parent6160b51adcb48d48c64803cc3d96ae8d50592ea9 (diff)
downloadandroid_system_bt-87103690db63b90641fcc4c33c67df3be61404cd.tar.gz
android_system_bt-87103690db63b90641fcc4c33c67df3be61404cd.tar.bz2
android_system_bt-87103690db63b90641fcc4c33c67df3be61404cd.zip
Snap for 5698743 from 6160b51adcb48d48c64803cc3d96ae8d50592ea9 to qt-release
Change-Id: I2563419552856ab8ad82f50fc5436e18a527a2d3
-rw-r--r--test/rootcanal/bluetooth_hci.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/test/rootcanal/bluetooth_hci.cc b/test/rootcanal/bluetooth_hci.cc
index 3e4297bfc..384da7383 100644
--- a/test/rootcanal/bluetooth_hci.cc
+++ b/test/rootcanal/bluetooth_hci.cc
@@ -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;