mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Remove spurious log entries
PiperOrigin-RevId: 451426941
This commit is contained in:
committed by
Copybara-Service
parent
519144eb24
commit
10605d5534
@@ -68,7 +68,6 @@ 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;
|
||||
@@ -78,14 +77,12 @@ 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()) {
|
||||
@@ -93,7 +90,6 @@ bool BluetoothClassicMedium::StopDiscovery() {
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "StopDiscovery left critical section.";
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -185,8 +181,6 @@ 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>();
|
||||
|
||||
@@ -204,13 +198,11 @@ 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;
|
||||
}
|
||||
@@ -373,7 +365,6 @@ 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.
|
||||
@@ -391,7 +382,6 @@ 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();
|
||||
}
|
||||
@@ -414,7 +404,6 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added(
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Added left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -422,8 +411,6 @@ 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() << " ("
|
||||
@@ -432,7 +419,6 @@ 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();
|
||||
}
|
||||
|
||||
@@ -440,7 +426,6 @@ 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();
|
||||
}
|
||||
@@ -452,7 +437,6 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section.";
|
||||
|
||||
return winrt::fire_and_forget();
|
||||
}
|
||||
@@ -460,14 +444,12 @@ 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();
|
||||
}
|
||||
@@ -480,7 +462,6 @@ 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