To make the nearby_presence_unittests.cc more percise, the test should create the metadata and pass it to the fake client instead of the client creating it. This change also allows for the unittests to use RunLoop instead of RunUntilIdeal in multiple places.
Bug: b/285015071
PiperOrigin-RevId: 553297388
Previously, `Device` trait was implemented by both Classic and BLE
Devices. This forced usage of associated types for choosing the type of
address employed, bringing about limitations of Rust's type system. By
ensuring cross-platform traits are only used for shared cross-platform
behavior, there are no longer type annotation issues in the application
layer.
Changes:
* Split the `Device` trait into `ClassicDevice` and `BleDevice`.
* Migrated these to an `api/` module to avoid name clashes and clearly
differentiate common structs (under `common/) from common traits (under
`api/)`.
* Removed shared `Address` enum in order to get rid of device's address
associated type.
* Application layer can now only talk to impl traits rather than the concrete
platform-specific type. This ensures compile-time behavior guarantees.
Constructors for cross-platform impls provided under the `Platform`
unit struct.
* Updated `unsupported` module for unsupported platforms. Previously,
dummy inherent impls would've been necessary for calling the `new()`
method. This is now part of the `ClassicDevice` and `BleDevice` API,
so cross-platform behavior is guaranteed to work.
Rust's type system is causing issues with notating associated types. For
now, concrete types will be used, but this will be fixed when the API is
updated with splitting Device into ClassicDevice and BleDevice.
Add the second step of retroactive pairing.
The client should:
* start retroactive pairing
* get user consent
* finish retroactive pairing
PiperOrigin-RevId: 551934024
endpoint_lost_by_medium_alarms_ should be accessed only
on PCP handler thread to avoid race conditions.
Added thread annotations to protect against accidental use on a different thread.
Test only change.
PiperOrigin-RevId: 551919704
Fixes an issue where if a characteristic is created and then updated with a non-nil value, and a new characteristic under the same service is added, then when the service is re-added the old characteristic will be permanently cached and the dynamic reads will stop working.
This also eliminates the issue when characteristics are created concurrently, since service additions are batched, if the service addition fails then only one of the characteristics will know that it failed to get added.
This change also introduces the nuance of "success" does not mean the CoreBluetooth method has completed successfully, but instead means that the intended state has been recorded and the class will do its best to maintain that state. For example, a successful "start advertising" call means that we have the advertisement cached and we will start advertising as soon as we can (like BT transitions from off to on) and will do our best to keep advertising (like BT transitions from on to off to on again).
PiperOrigin-RevId: 551660634
The client can call DisconnectFromEndpointManager() explicitly before
BasePcpHandler is shut down. In this case, th executors were not terminated
inside BasePcpHandler::Shutdown()
This caused use-after-free errors in BasePcpHandlerTest.IoError_RequestConnectionFails
PiperOrigin-RevId: 551340708