From 306e5df90a1ed20e5f0adee37031336d1a1c824b Mon Sep 17 00:00:00 2001 From: hai007 Date: Tue, 17 Feb 2026 07:09:12 -0800 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 871299383 --- .../windows/bluetooth_classic_device.cc | 6 ----- .../windows/bluetooth_classic_socket.cc | 22 +++++-------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/internal/platform/implementation/windows/bluetooth_classic_device.cc b/internal/platform/implementation/windows/bluetooth_classic_device.cc index c796c1e6..a419aabf 100644 --- a/internal/platform/implementation/windows/bluetooth_classic_device.cc +++ b/internal/platform/implementation/windows/bluetooth_classic_device.cc @@ -77,12 +77,6 @@ MacAddress BluetoothDevice::GetMacAddress() const { return mac_address_; } // Checks cache first, will check uncached if no result. RfcommDeviceService BluetoothDevice::GetRfcommServiceForIdAsync( RfcommServiceId serviceId) { - if (nearby::NearbyFlags::GetInstance().GetBoolFlag( - platform::config_package_nearby::nearby_platform_feature:: - kEnableNewBluetoothRefactor)) { - return GetRfcommServiceForIdWithRetryAsync(serviceId); - } - try { LOG(INFO) << __func__ << ": Get RF services for service id:" << winrt::to_string(serviceId.AsString()); diff --git a/internal/platform/implementation/windows/bluetooth_classic_socket.cc b/internal/platform/implementation/windows/bluetooth_classic_socket.cc index 199f17b1..92316cc1 100644 --- a/internal/platform/implementation/windows/bluetooth_classic_socket.cc +++ b/internal/platform/implementation/windows/bluetooth_classic_socket.cc @@ -146,29 +146,19 @@ bool BluetoothSocket::Connect(HostName connection_host_name, LOG(INFO) << __func__ << ": start to connect to bluetooth service:" << winrt::to_string(connection_service_name); - if (nearby::NearbyFlags::GetInstance().GetBoolFlag( - platform::config_package_nearby::nearby_platform_feature:: - kEnableNewBluetoothRefactor)) { + int connect_called_count = 0; + while (connect_called_count < kMaxConnectRetryCount) { + connect_called_count += 1; bool connect_result = InternalConnect(connection_host_name, connection_service_name); if (connect_result) { return connect_result; } - } else { - int connect_called_count = 0; - while (connect_called_count < kMaxConnectRetryCount) { - connect_called_count += 1; - bool connect_result = - InternalConnect(connection_host_name, connection_service_name); - if (connect_result) { - return connect_result; - } - LOG(WARNING) << __func__ << ": Failed to connect bluetooth at the " - << connect_called_count << "th call."; + LOG(WARNING) << __func__ << ": Failed to connect bluetooth at the " + << connect_called_count << "th call."; - absl::SleepFor(kConnectInterval); - } + absl::SleepFor(kConnectInterval); } LOG(WARNING) << __func__ << ": Failed to connect bluetooth";