mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Remove spurious log entries
PiperOrigin-RevId: 452106082
This commit is contained in:
committed by
Copybara-Service
parent
e096c7e666
commit
0521012f83
@@ -68,6 +68,7 @@ void BluetoothClassicMedium::OnScanModeChanged(
|
||||
bool BluetoothClassicMedium::StartDiscovery(
|
||||
BluetoothClassicMedium::DiscoveryCallback discovery_callback) {
|
||||
EnterCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "StartDisovery entered critical section.";
|
||||
|
||||
bool result = false;
|
||||
discovery_callback_ = discovery_callback;
|
||||
@@ -77,12 +78,14 @@ bool BluetoothClassicMedium::StartDiscovery(
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "StartDisovery left critical section.";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool BluetoothClassicMedium::StopDiscovery() {
|
||||
EnterCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "StopDiscovery entered critical section.";
|
||||
bool result = false;
|
||||
|
||||
if (IsWatcherStarted()) {
|
||||
@@ -90,6 +93,7 @@ bool BluetoothClassicMedium::StopDiscovery() {
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "StopDiscovery left critical section.";
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -181,6 +185,8 @@ std::unique_ptr<api::BluetoothSocket> BluetoothClassicMedium::ConnectToService(
|
||||
}
|
||||
|
||||
EnterCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "ConnectToService entered critical section.";
|
||||
|
||||
std::unique_ptr<BluetoothSocket> rfcommSocket =
|
||||
std::make_unique<BluetoothSocket>();
|
||||
|
||||
@@ -198,11 +204,13 @@ std::unique_ptr<api::BluetoothSocket> BluetoothClassicMedium::ConnectToService(
|
||||
<< exception.what();
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "ConnectToService left critical section.";
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "ConnectToService left critical section.";
|
||||
|
||||
return rfcommSocket;
|
||||
}
|
||||
@@ -365,6 +373,7 @@ bool BluetoothClassicMedium::StopScanning() {
|
||||
winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added(
|
||||
DeviceWatcher sender, DeviceInformation deviceInfo) {
|
||||
EnterCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Added entered critical section.";
|
||||
NEARBY_LOGS(INFO) << "Device added " << winrt::to_string(deviceInfo.Id());
|
||||
if (IsWatcherStarted()) {
|
||||
// Represents a Bluetooth device.
|
||||
@@ -382,6 +391,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added(
|
||||
// "DeviceWatcher_Added entered critical section.";
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Added left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -404,6 +414,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added(
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Added left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -411,6 +422,8 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added(
|
||||
winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate) {
|
||||
EnterCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Updated entered critical section.";
|
||||
|
||||
NEARBY_LOGS(INFO)
|
||||
<< "Device updated "
|
||||
<< discovered_devices_by_id_[deviceInfoUpdate.Id()]->GetName() << " ("
|
||||
@@ -419,6 +432,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
if (!IsWatcherStarted()) {
|
||||
// Spurious call, watcher has stopped or wasn't started
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section.";
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
|
||||
@@ -426,6 +440,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
|
||||
if (it == discovered_devices_by_id_.end()) {
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section.";
|
||||
// Not tracking this device
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -437,6 +452,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -444,12 +460,14 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Removed(
|
||||
DeviceWatcher sender, DeviceInformationUpdate deviceInfo) {
|
||||
EnterCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Removed entered critical section.";
|
||||
NEARBY_LOGS(INFO) << "Device removed "
|
||||
<< discovered_devices_by_id_[deviceInfo.Id()]->GetName()
|
||||
<< " (" << winrt::to_string(deviceInfo.Id()) << ")";
|
||||
|
||||
if (!IsWatcherStarted()) {
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Removed left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -462,6 +480,7 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Removed(
|
||||
discovered_devices_by_id_.erase(deviceInfo.Id());
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Removed left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user