Add CancellationFlag::Uncancel and on calls to ClientProxy::AddCancellationFlag, if a flag is already in the map, uncancel it. This will address the case when users use NC to share/receive a file, then cancel in the middle because the wrong file was selected, and then re-do right after. Without this change, the second share/receive process will be seen as cancelled with cancellation flags enabled. However this change will uncancel the flag which is added in RequestConnection and OnConnectionInitiated in the NS flow.
PiperOrigin-RevId: 540633470
CancellationFlags will be used to prevent crashes during the shutdown of Nearby Connections from pending tasks taking too long during the shutdown period. By using CancellationFlags, we can prevent the retries occuring during the Shutdown by short-circuiting an in flight AttemptToConnect, and checking for Cancellation before retries.
Because BluetoothClassic does not use futures, the short circuit only requires a check after ConnectToService, and returning an empty
socket.
PiperOrigin-RevId: 539755631
CancellationFlags will be used to prevent crashes during the shutdown of Nearby Connections from pending tasks taking too long during the shutdown period. WebRTC using 3 x 10s retries to connect, which means we are potentially waiting for 30 seconds of retries to execute during shutdown (which is longer than the 10s duration alloted for Core shutdown).
By using CancellationFlags, we can prevent the retries occuring during the Shutdown by short-circuiting an in flight AttemptToConnect, and checking for Cancellation before retries.
PiperOrigin-RevId: 539690403
Keep all discovered and explicitly created BLE peripherals in the same
collection.
The peripherals are removed when they haven't been used for a while.
PiperOrigin-RevId: 538349622
FastPairScanner::ScanningSession and ScannerBroker::ScanningSession separate
the lifetime of FastPairScanner/ScannerBroker from the lifetime of scanning
sessions. This simplifies the cleanup.
PiperOrigin-RevId: 535675988
Objective-C objects cannot be captured by reference in C++ lambdas and must always be captured by value.
This also takes a copy of the data returned from the Wi-Fi LAN reader, to prevent potential intermittent empty packet issues.
Fixes: #1702
PiperOrigin-RevId: 533925980