Check BLE extended feature before use it

PiperOrigin-RevId: 513637981
This commit is contained in:
Guogang Li
2023-03-02 14:20:03 -08:00
committed by Copybara-Service
parent 9542a4812d
commit 5c9166c02d
@@ -185,7 +185,8 @@ bool BleMedium::StartAdvertising(
// Use Extended Advertising if Fast Advertisement Service Uuid is empty
// string because the long format advertisement will be used
if (fast_advertisement_service_uuid.empty()) {
if (adapter_->IsExtendedAdvertisingSupported() &&
fast_advertisement_service_uuid.empty()) {
publisher_ = BluetoothLEAdvertisementPublisher(advertisement);
publisher_.UseExtendedAdvertisement(true);
} else {