From: Myles Watson Date: Fri, 12 Apr 2019 21:30:51 +0000 (-0700) Subject: RootCanal: Open network ports only if there is a console X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0ffd38f3a3;p=android-x86%2Fsystem-bt.git RootCanal: Open network ports only if there is a console Bug: 128355308 Test: toggle airplane mode and check for opening sockets Change-Id: I8c4581b708c05a8c72dba3604c02adea97c1653b --- diff --git a/test/rootcanal/bluetooth_hci.cc b/test/rootcanal/bluetooth_hci.cc index 2fd68cb80..bdd44c5ac 100644 --- a/test/rootcanal/bluetooth_hci.cc +++ b/test/rootcanal/bluetooth_hci.cc @@ -124,9 +124,11 @@ Return BluetoothHci::initialize(const sp& cb) { if (BtTestConsoleEnabled()) { SetUpTestChannel(6111); + SetUpHciServer(6211, + [this](int fd) { test_model_.IncomingHciConnection(fd); }); + SetUpLinkLayerServer( + 6311, [this](int fd) { test_model_.IncomingLinkLayerConnection(fd); }); } - SetUpHciServer(6211, [this](int fd) { test_model_.IncomingHciConnection(fd); }); - SetUpLinkLayerServer(6311, [this](int fd) { test_model_.IncomingLinkLayerConnection(fd); }); unlink_cb_ = [cb](sp& death_recipient) { if (death_recipient->getHasDied())