46 Commits
Author SHA1 Message Date
Francis Tsui 000e12da8e Migrate platform to use MacAddress class.
PiperOrigin-RevId: 800631540
2025-08-28 15:14:16 -07:00
hai007 cc2c6c527b Implement AWDL in connection layer (part 2)
PiperOrigin-RevId: 744206141
2025-04-05 01:49:16 -07:00
Guogang Li 5eab533260 Simplify the dependency in mediums
PiperOrigin-RevId: 736346209
2025-03-12 19:27:47 -07:00
Edwin Wu ed79ce5f03 [NearbyConnection] Change the parameter names from connection_info to pending_connection_info
PiperOrigin-RevId: 714284466
2025-01-10 17:43:45 -08:00
Edwin Wu a08b420545 analytics: Modify the returned code with a new OperationResultCodeWithMediums for Bluetooth - StartAdvertising/UpdateAdvertisingOptions, I
PiperOrigin-RevId: 704310956
2024-12-09 09:22:18 -08:00
Edwin Wu 9a434f3ec3 analytics: Implement to pass values for OperatoinResultWithMedium.
PiperOrigin-RevId: 704304596
2024-12-09 09:02:05 -08:00
Edwin Wu c3a479e526 analytics: Add OperationResultCode to ConnectionAttempt, II
PiperOrigin-RevId: 704166113
2024-12-09 00:03:41 -08:00
Guogang Li f391af8e47 Enhance on Bluetooth discovery check
PiperOrigin-RevId: 691947459
2024-10-31 15:05:16 -07:00
Guogang Li 4088e5904f Control Wi-Fi hotspot as client by flag
PiperOrigin-RevId: 663862186
2024-08-16 14:17:40 -07:00
Guogang Li c4812a2082 Optimized instant on lost
PiperOrigin-RevId: 659567920
2024-08-05 08:49:36 -07:00
Guogang Li 4f386b95db Added logic to stabilize endpoint IDs
PiperOrigin-RevId: 644407047
2024-06-18 09:11:51 -07:00
Eiden Kim 51dcfe807d Fix a crash in BasePcpHandler::BreakTie.
PiperOrigin-RevId: 638412219
2024-05-29 14:26:23 -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 5f616fa592 [Nearby Presence] Pass remote device and EndpointManager throughout connection flow
In order to construct the `ConnectionsAuthenticationTransport` and authentication the connection with the `DeviceProvider`, the remote NearbyDevice and EndpointManager used in RequestConnectionV3() must be passed through the encryption protocol as parameters. This CL accomplishes this; it passes the remote NearbyDevice and EndpointManager through a successful encryption flow by introducting new functions to support this V3 protocol. They will be used in a follow up CL to authenticate the connection. See go/cros-nearby-presence-np-nc-authentication  for details.

PiperOrigin-RevId: 610810602
2024-02-27 11:05:52 -08:00
Juliet Levesque d497c2e97c [Nearby Presence] Add authentication status to PendingConnectionInfo
Adds authentication status to `PendingConnectionInfo`, 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: 607402836
2024-02-15 11:39:55 -08:00
Janusz Sobczak 56acecdffa Migrate to AnyInvocable in DiscoveryListener
PiperOrigin-RevId: 571077933
2023-10-05 11:20:17 -07:00
Juliet Levesque 8be118a3d0 [Nearby Connections] Plumb remote device information much deeper into the stack
This will be needed for the authentication transport as the verifier will need the information about the remote device. This CL is based on logic from
awadhera@ in cl/539175992 with additional unit test coverage.

PiperOrigin-RevId: 565037849
2023-09-13 06:59:50 -07:00
hai007 55aedfb235 Implement Safe to Disconnect feature
PiperOrigin-RevId: 560119556
2023-08-25 09:51:44 -07:00
Janusz Sobczak 5acf702660 Use endpoint lost alarms on PCP handler thread only
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
2023-07-28 12:21:32 -07:00
Janusz Sobczak cae06bd15d Close executors in BasePcpHandler::Shutdown
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
2023-07-26 16:00:08 -07:00
Anay Wadhera 8450f2b607 add ConnectionsDevice/PresenceDevice to offline frames builders.
PiperOrigin-RevId: 549380626
2023-07-19 11:46:30 -07:00
Janusz Sobczak 9f42452386 Fix PCP handler cleanup
All tasks in base_pcp_handler must complete before
p2p_cluster_pcp_handler is destroyed to prevent use-after-free errors.

Added a couple of missing StopDiscovery calls.

PiperOrigin-RevId: 547931350
2023-07-13 14:56:14 -07:00
Anay Wadhera 4ecbd3bca1 Filter devices based on type when listening for incoming connections.
PiperOrigin-RevId: 546124493
2023-07-06 16:40:00 -07:00
Anay Wadhera 5369c33112 fix tsan error in NC when accessing discovered_endpoints
PiperOrigin-RevId: 546060069
2023-07-06 12:22:55 -07:00
Anay Wadhera f05e24f7ea Plumb updateDiscoveryOptions into pcp handler.
PiperOrigin-RevId: 544431325
2023-06-29 12:33:16 -07:00
Anay Wadhera 1ddd4d91ea Check listening options when checking for bwu possibility
PiperOrigin-RevId: 543509150
2023-06-26 12:22:49 -07:00
Anay Wadhera c5c65714a0 Implement updateAdvertisingOptions
PiperOrigin-RevId: 543502031
2023-06-26 11:55:11 -07:00
Anay Wadhera 7f1d6a4bba Check listening options as well when we want to enforce topology constraints
PiperOrigin-RevId: 543497497
2023-06-26 11:40:17 -07:00
Anay Wadhera 5da4b33824 Revert "Revert incoming connections listener changes for internal breakages."
PiperOrigin-RevId: 542381558
2023-06-21 15:36:44 -07:00
Anay Wadhera 1973b09849 Revert incoming connections listener changes for internal breakages.
PiperOrigin-RevId: 542010849
2023-06-20 12:16:10 -07:00
Anay Wadhera 44fb9b4fa2 implement stoplisteningforincomingconnections
PiperOrigin-RevId: 540724954
2023-06-15 16:43:56 -07:00
Anay Wadhera 5737b867ed implement startlisteningforincomingconnections
PiperOrigin-RevId: 540707703
2023-06-15 15:31:08 -07:00
Anay Wadhera 0ab31f6312 Implement device loss alarms
PiperOrigin-RevId: 538822094
2023-06-08 10:19:44 -07:00
Anay Wadhera f2cadc2815 move payload listeners to absl::AnyInvocable
PiperOrigin-RevId: 533365325
2023-05-18 23:30:01 -07:00
Nick Bourdakos a933a91413 Internal Change
PiperOrigin-RevId: 520165614
2023-03-28 16:26:40 -07:00
hai007 e2fa1d0409 Fix the supported mediums error
PiperOrigin-RevId: 509999913
2023-02-15 19:54:05 -08:00
Suet-Fei Li 084f7ebd88 Remove location namespace in third_party/nearby.
PiperOrigin-RevId: 500023196
2023-01-06 02:53:57 -08:00
Eiden Kim 7350643c36 Update Prng usage so that it can generate random values on different threads.
PiperOrigin-RevId: 478025630
2022-09-30 10:31:27 -07:00
hai007 8f681dece0 Throughput profiling
PiperOrigin-RevId: 477752265
2022-09-29 10:02:11 -07:00
hai007 a9d7061794 Group Connection Info into structure
PiperOrigin-RevId: 454663252
2022-06-13 11:49:53 -07:00
edwinwu c96875f310 Fixes A go/asan error (heap_use_after_free) found while running //third_party/nearby/connections/implementation:core_internal_test
PiperOrigin-RevId: 454288190
2022-06-10 20:00:03 -07:00
hai007 500f67c85e Add Wifi Medium to query WIFI interface capability and information
PiperOrigin-RevId: 451233512
2022-05-26 13:40:14 -07:00
edwinwu 412f9e0752 [BLE Refactor] Connects BleV2 mediums to PCP handler.
PiperOrigin-RevId: 449196646
2022-05-17 05:42:05 -07:00
edwinwu 771ce23fa3 [BLE Refactor] Implements advertisement tracking in Ble medium with DiscoveredPeripheralTracker class.
PiperOrigin-RevId: 447397658
2022-05-09 00:36:33 -07:00
nohle 463d391fcd [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (1/4)
This CL should be a no-op.

Provide better access to the service ID during bandwidth upgrade handling. Notably, 1) have the endpoint channel store its associated service ID, and 2) send the service ID on a connect/disconnect.

The service ID identifies the application, for example, "NearbySharing". In future CLs, we will use the service IDs to better handle bandwidth-upgrade bookkeeping when multiple services are running simultaneously. Specifically, we will better handle reverting a bandwidth-upgrade medium without interfering with other services.

PiperOrigin-RevId: 442019209
2022-04-15 08:15:53 -07:00
hais f5fcd35ced nearby sdk refactor
PiperOrigin-RevId: 425434260
2022-02-02 11:56:39 -08:00