[Nearby Connections] Use async StartScanning when flag enabled

Creates the feature flag `enable_ble_v2_async_scanning_advertising` which
enables/disables the use of the async StartScanning, StopScanning,
StartAdvertising, StopAdvertising, etc methods over the soon-to-be deprecated
synchronous versions of those methods. Opted for feature flag over NearbyFlag,
as ChromeOS is the only current consumer and doesn't use Mendel.

Also sets the feature flag to enabled in the ServiceControllerRouter, which
is where ChromeOS sets NC feature flags at startup.

This CL also fully links up the asynchronous Scanning methods. Advertising
will be addressed in a follow up CL.

PiperOrigin-RevId: 608158273
This commit is contained in:
Daniel Classon
2024-02-18 12:59:02 -08:00
committed by Copybara-Service
parent 88064b1543
commit f09368247b
7 changed files with 522 additions and 5 deletions
+3 -3
View File
@@ -463,9 +463,9 @@ class BleMedium {
};
// Async interface for StartScanning.
// Result status will be passed to start_advertising_result callback.
// To stop advertising, invoke the stop_advertising callback in
// AdvertisingSession.
// Result status will be passed to start_scanning_result callback.
// To stop scanning, invoke the stop_scanning callback in
// ScanningSession.
virtual std::unique_ptr<ScanningSession> StartScanning(
const Uuid& service_uuid, TxPowerLevel tx_power_level,
ScanningCallback callback) = 0;