Internal change

PiperOrigin-RevId: 364353126
This commit is contained in:
hai007
2021-03-22 10:38:20 -07:00
committed by Copybara-Service
parent c648983d52
commit ae283c7cb6
14 changed files with 277 additions and 43 deletions
+4 -7
View File
@@ -255,16 +255,14 @@ bool Ble::StartAcceptingConnections(const std::string& service_id,
if (IsAcceptingConnectionsLocked(service_id)) {
NEARBY_LOGS(INFO)
<< "Refusing to start accepting BLE connections for "
<< service_id
<< "Refusing to start accepting BLE connections for " << service_id
<< " because another BLE peripheral socket is already in-progress.";
return false;
}
if (!radio_.IsEnabled()) {
NEARBY_LOGS(INFO) << "Can't start accepting BLE connections for "
<< service_id
<< " because Bluetooth isn't enabled.";
<< service_id << " because Bluetooth isn't enabled.";
return false;
}
@@ -310,7 +308,6 @@ bool Ble::IsAcceptingConnectionsLocked(const std::string& service_id) {
return accepting_connections_info_.Existed(service_id);
}
// TODO(b/169303284): Handles Cancellation and registration.
BleSocket Ble::Connect(BlePeripheral& peripheral, const std::string& service_id,
CancellationFlag* cancellation_flag) {
MutexLock lock(&mutex_);
@@ -324,8 +321,8 @@ BleSocket Ble::Connect(BlePeripheral& peripheral, const std::string& service_id,
}
if (!radio_.IsEnabled()) {
NEARBY_LOGS(INFO) << "Can't create client BLE socket to "
<< &peripheral << " because Bluetooth isn't enabled.";
NEARBY_LOGS(INFO) << "Can't create client BLE socket to " << &peripheral
<< " because Bluetooth isn't enabled.";
return socket;
}
@@ -344,7 +344,6 @@ bool BluetoothClassic::StopAcceptingConnections(
return true;
}
// TODO(b/169303284): Handles Cancellation and registration.
BluetoothSocket BluetoothClassic::Connect(BluetoothDevice& bluetooth_device,
const std::string& service_name,
CancellationFlag* cancellation_flag) {
-1
View File
@@ -222,7 +222,6 @@ bool WifiLan::IsAcceptingConnectionsLocked(const std::string& service_id) {
return accepting_connections_info_.Existed(service_id);
}
// TODO(b/169303284): Handles Cancellation and registration.
WifiLanSocket WifiLan::Connect(WifiLanService& wifi_lan_service,
const std::string& service_id,
CancellationFlag* cancellation_flag) {