Fix infinite loop if GATT server fails to start initially.

PiperOrigin-RevId: 736972233
This commit is contained in:
Francis Tsui
2025-03-14 13:43:45 -07:00
committed by Copybara-Service
parent f7e97d23fe
commit 528ae4c4e2
@@ -451,6 +451,9 @@ bool BleGattServer::StartAdvertisement(const ByteArray& service_data,
if (absl::Milliseconds(wait_milliseconds) > kGattServerTimeout) {
LOG(ERROR) << __func__
<< ": Failed to start GATT advertising due to timeout.";
// GattServiceProvider can become Started after the timeout. Stop
// waiting for the status change and continue as if it has started..
break;
}
}