Commit Graph
67 Commits
Author SHA1 Message Date
Francis Tsui 52475a9cb3 Internal changes
PiperOrigin-RevId: 802310547
2025-09-02 15:32:47 -07:00
Ivo Ristovski List 038c73520d Automated Code Change
PiperOrigin-RevId: 802282871
2025-09-02 14:04:04 -07:00
Nick Bourdakos 3caae8d58d Remove compatible_with from Bazel targets
PiperOrigin-RevId: 698102508
2024-11-19 12:19:39 -08:00
hai007 50c1838e00 Use rust based decoding logic by default
PiperOrigin-RevId: 629850723
2024-05-01 15:09:13 -07:00
Ryan Hansberry 5c933e5b9c [Device Provider] Add FakeDeviceProvider for testing
Create a FakeDeviceProvider class which will be used in testing for NearbyPresence
and NearbyConnections. To assist with testing PresenceService will store a NearbyDeviceProvider base class instead of the implementation specific PresenceDeviceProvider.

PiperOrigin-RevId: 625845617
2024-04-17 16:47:31 -07:00
Juliet Levesque f235957345 [Nearby Presence] Authenticate the connection using the DeviceProvider
Once the encryption protocol has been completed successfully, authentication the connection using the registered DeviceProvider from the ClientProxy. For the Nearby Presence MVP, this will be the PresenceDeviceProvider and will only support outgoing connections, which is why the responder role is not used. The result (success or failure) is passed back to callers via the EndpointManager. See go/cros-nearby-presence-np-nc-authentication  for details.

PiperOrigin-RevId: 611255632
2024-02-28 15:51:37 -08:00
Juliet Levesque fb1f01717f [Nearby Presence] Add authentication status to ConnectionInfo
Adds authentication status to `ConnectionInfo`, which will pass the result of the authentication to clients when the connection is complete. See go/cros-nearby-presence-np-nc-authentication for details. This will be used in follow up CL to communicate the authentication status to clients of RequestConnectionV3().

PiperOrigin-RevId: 606789503
2024-02-13 16:49:49 -08:00
Juliet Levesque caf34a717f [Nearby Presence] Read response data from remote device
see go/cros-nearby-presence-np-nc-authentication for details.

PiperOrigin-RevId: 606772097
2024-02-13 15:50:07 -08:00
Crisrael Lucero 6ad4bf75e2 [Nearby Presence] Use absl/variant instead of std in PresenceDeviceProvider
PiperOrigin-RevId: 604464809
2024-02-05 16:19:52 -08:00
Juliet Levesque 58452f4049 [Nearby Presence] Construct Presence Frame and write to remote device
Constructs a Presence frame using BuildSignedMessageAsInitiator() and write to the AuthenticationTransport for authentication. In follow up CL's, authentication protocol will read the message from the remote device and verify it - see go/cros-nearby-presence-np-nc-authentication for details.

PiperOrigin-RevId: 603776791
2024-02-02 17:24:47 -08:00
Juliet Levesque 6b2f7fa94e [Nearby Presence] Fetch and select correct local credentials
Fetch the local credentials and select the correct local credential by verifying the validity of the time. This CL will be followed by
using the selected local credential for authentication. See go/cros-nearby-presence-np-nc-authentication  for details.

PiperOrigin-RevId: 603772266
2024-02-02 17:23:41 -08:00
Juliet Levesque aaa1bea130 [Nearby Presence] Expose API's to fetch local credentials
Expose APIs to fetch local credentials from the CredentialManager, which will be used to fetch a local credential to be used for authentication in follow up CL's. See go/cros-nearby-presence-np-nc-authentication  for details.

PiperOrigin-RevId: 601781066
2024-01-26 09:04:16 -08:00
Janusz Sobczak 5393daf9f1 Merge logging and types build targets
Both "types" and "logging" build targets included "logging.h"
Merging them together avoids circular dependencies.

PiperOrigin-RevId: 555262816
2023-08-09 19:13:12 -07:00
Crisrael Lucero 001069faa1 Convert std::variant usage to absl::variant
PiperOrigin-RevId: 546987633
2023-07-10 14:43:27 -07:00
Anay Wadhera 6624dd003e Implement NearbyDevice::ToProto() for PresenceDevice
PiperOrigin-RevId: 546372521
2023-07-07 13:40:13 -07:00
Anay Wadhera cf8afb73aa Use alphanumeric characters for PresenceDevice endpoint id generation
PiperOrigin-RevId: 540321021
2023-06-14 10:59:49 -07:00
Juliet Levesque 3a49499de4 [Nearby Presence] Refactor PresenceService to use Impl model
Refactors PresenceService to have a pure virtual base class and an
implemnetation.

PiperOrigin-RevId: 539125804
2023-06-09 10:59:40 -07:00
hai007 1be7e82b4f [Nearby Presence] Create presence client factory and fake
Add a presence client factory and fake_presence_client to help facilitate presence client testing. This testing infrastructure is used in crrev/c/4528575 to test the nearby presence mojom interface.

PiperOrigin-RevId: 535087368
2023-05-24 20:56:04 -07:00
Anay Wadhera f21b1e7089 internal change
PiperOrigin-RevId: 529179617
2023-05-03 13:32:34 -07:00
Anay Wadhera 21d2efbccd Create PresenceDeviceProvider
PiperOrigin-RevId: 528913199
2023-05-02 16:02:36 -07:00
Anay Wadhera 5edd8e25ca Introduce v3 NC API callbacks
PiperOrigin-RevId: 527747390
2023-04-27 19:01:39 -07:00
Hai Shang c312442f3d internal clean up
PiperOrigin-RevId: 521555239
2023-04-03 14:00:22 -07:00
Hai Shang 47b7a04939 minor clean up
PiperOrigin-RevId: 520734787
2023-03-30 13:56:57 -07:00
Nick Bourdakos 14e7832be0 Internal change
PiperOrigin-RevId: 520638739
2023-03-30 12:34:53 -07:00
Nick Bourdakos 39df20d821 Internal change
PiperOrigin-RevId: 518186148
2023-03-20 23:51:16 -07:00
Janusz Sobczak 5f4144cd0b Update SharedCredential definition
PiperOrigin-RevId: 507568902
2023-02-06 13:33:23 -08:00
Anay Wadhera 16af6a7e6b Allow tests to be runnable on Windows
PiperOrigin-RevId: 506364864
2023-02-01 10:59:01 -08:00
Janusz Sobczak a29be214a3 Migrate to absl::AnyInvocable in NP.
Replaces a bunch of std::function uses with absl::AnyInvocable.

PiperOrigin-RevId: 502960326
2023-01-18 13:16:29 -08:00
Janusz Sobczak 0d14b885ea Use absl::Status instead of custom status
PiperOrigin-RevId: 497054898
2022-12-21 19:11:55 -08:00
Janusz Sobczak f0d36f8d8d Add StopBroadcast
Use explicit StopBroadcast API instead of a callback in BoroadcastSession.

PiperOrigin-RevId: 491759852
2022-11-29 16:00:28 -08:00
Anay Wadhera b7415ecd40 Implement NearbyDevice for PresenceDevice.
PiperOrigin-RevId: 491705794
2022-11-29 12:19:47 -08:00
Anay Wadhera 52d81710a2 Add fields to PresenceDevice
PiperOrigin-RevId: 490345719
2022-11-22 15:03:09 -08:00
Janusz Sobczak 49d47d8e16 Fix dependency between PresenceClient and PresenceService
Give PresenceClient a borrowable reference to PresenceService. Benefits:
1. PresenceClient can verify if PresenceService is alive before trying to access it.
2. The calls to PresenceService are serialized.
3. PresenceService will not be destroyed while a PresenceClient is using it.

PiperOrigin-RevId: 489590767
2022-11-18 16:52:35 -08:00
Janusz Sobczak 951945dd5c Add AdvertisementData struct.
Define and use an NP private AdvertisementData structure instead of the low level BleAdvertisementData,
The APIs look cleaner this way.

PiperOrigin-RevId: 486224840
2022-11-04 14:03:24 -07:00
Hai Shang de4e7a66dc Utilize ScanManager for scan operation in service controller.
PiperOrigin-RevId: 486208283
2022-11-04 12:50:19 -07:00
Anay Wadhera bc21803bee Include internal/platform/logging.h to pick the correct logging library
PiperOrigin-RevId: 486016407
2022-11-03 17:34:41 -07:00
Anay Wadhera 373a694b32 Add missing die_if_null and flat_hash_map dependency to fix build error
PiperOrigin-RevId: 485938749
2022-11-03 12:14:16 -07:00
Anay Wadhera 74f7f5ec5c Fix visibility rules
PiperOrigin-RevId: 485897261
2022-11-03 09:44:47 -07:00
Hai Shang b056e6561a Add manager_app_id to scan and broadcast requests
PiperOrigin-RevId: 485745403
2022-11-02 18:14:27 -07:00
Hai Shang 054f6efe53 Chain scan & broadcast invokes from PresenceClient to ServiceController
PiperOrigin-RevId: 483496670
2022-10-24 15:12:43 -07:00
Hai Shang 57a8d8420c update presence client
PiperOrigin-RevId: 479424213
2022-10-06 15:17:26 -07:00
Janusz Sobczak 560253baa9 Clean up build file
Each source file should be compiled into just one target.

PiperOrigin-RevId: 473084337
2022-09-08 14:26:10 -07:00
Janusz Sobczak 408900e702 Define StartBroadcast API.
Changed StartBroadcast() API to be more generic - the client app can use the
same call to start presence, fast pair or eddystone advertisement.

PiperOrigin-RevId: 470066137
2022-08-25 13:16:17 -07:00
Xin He f166f1e22c Remove presence_identity struct.
PiperOrigin-RevId: 468032143
2022-08-16 14:56:38 -07:00
Hai Shang 0849bc7598 Use absl::variant for PresenceScanFilter and legacy.
PiperOrigin-RevId: 467982930
2022-08-16 11:44:49 -07:00
Xin He 123a2cfd18 Move credentials related proto from Prensence to internal
Replace PresenceIdentityType with proto

PiperOrigin-RevId: 467294239
2022-08-12 14:18:34 -07:00
Janusz Sobczak 8446944697 Hide internal code in implementation/
Refactoring change.

action_factory* -> implementation/action_factory*
broadcast_request* -> implementation/base_broadcast_request*
encryption* -> implementation/encryption*

Clean up build targets.

PiperOrigin-RevId: 466992367
2022-08-11 10:37:56 -07:00
Janusz Sobczak 07119e80de Merge CertificateManager and CredentialManager
Refactoring change.
Merge CertificateManager and CredentialManager into a single interface.
Hide AdvertisementFactory in implementation/. The client app will not be using
that class directly.
Clean up build targets.

PiperOrigin-RevId: 466748133
2022-08-10 11:46:16 -07:00
Suet-Fei Li 55f20775d2 Fix internal flow
PiperOrigin-RevId: 466426960
2022-08-09 12:02:16 -07:00
Janusz Sobczak 6e6ae3ebd7 Decode the action in Base NP advertisements back into a list of Data Elements
PiperOrigin-RevId: 466204445
2022-08-08 19:39:05 -07:00