Commit Graph
117 Commits
Author SHA1 Message Date
Anay Wadhera ec3cf6ca26 Add vendor ID from a registered receive surface to the advertisement.
PiperOrigin-RevId: 639091253
2024-05-31 11:11:05 -07:00
Francis Tsui aa277cc202 Switch to absl random to generate payload and attachment ids.
PiperOrigin-RevId: 638749436
2024-05-30 12:44:55 -07:00
Eiden Kim 7459330bd5 [Sharing] Add more unit tests for ProcessUnknownFilePathsToDelete
PiperOrigin-RevId: 638677572
2024-05-30 09:22:59 -07:00
Guogang Li 9b8d708a7f Add use_stable_endpoint_id to AdvertisingOptions
PiperOrigin-RevId: 638501216
2024-05-29 20:25:48 -07:00
Anay Wadhera b2efc04bb2 Introduce WrappedShareTargetDiscoveredCallback.
PiperOrigin-RevId: 638421531
2024-05-29 14:56:55 -07:00
Eiden Kim 4d21499342 [Sharing] Delete unknown payload with kProgress status
PiperOrigin-RevId: 638418216
2024-05-29 14:45:10 -07:00
Francis Tsui f15f7ecc24 Add kInvalidArgument status.
PiperOrigin-RevId: 638322753
2024-05-29 10:03:04 -07:00
Eiden Kim 25493f4241 Filter expected files out from the delete list.
PiperOrigin-RevId: 637746917
2024-05-27 19:23:40 -07:00
Francis Tsui 9c6cde0770 Remove auto app start flag from settings.
PiperOrigin-RevId: 637027668
2024-05-24 14:04:57 -07:00
Anay Wadhera a46531153d Refactor receive surface callbacks into a map of TransferUpdateCallback* to vendor ID.
PiperOrigin-RevId: 637001019
2024-05-24 12:30:36 -07:00
Anay Wadhera 60bba62294 Add vendor ID to register receive surface API.
PiperOrigin-RevId: 636986314
2024-05-24 11:42:37 -07:00
Anay Wadhera 7164bc98f6 Attach vendor ID to ShareTarget.
PiperOrigin-RevId: 636621178
2024-05-23 11:38:32 -07:00
Anay Wadhera 76a99ec941 Demystify FindEndpoint() in test code.
PiperOrigin-RevId: 636319141
2024-05-22 15:47:34 -07:00
Francis Tsui bf9b5ccb91 Rationalize disconnection handling.
PiperOrigin-RevId: 635985141
2024-05-21 18:00:13 -07:00
Anay Wadhera ffda9da870 Add TLV parsing and vendor ID tlv to C++ advertisement.
PiperOrigin-RevId: 635936457
2024-05-21 14:54:28 -07:00
Anay Wadhera 4472598508 Create advertisement class testing
PiperOrigin-RevId: 635621550
2024-05-20 17:47:22 -07:00
Anay Wadhera d9ee5ac253 Add vendor_id field to Advertisement class
PiperOrigin-RevId: 635569993
2024-05-20 14:25:26 -07:00
Francis Tsui 1ab16fda46 Fix UBSan error.
PiperOrigin-RevId: 635522535
2024-05-20 11:42:46 -07:00
Francis Tsui 4ff7c1511c Break nearby_sharing_service_test into smaller targets.
PiperOrigin-RevId: 634860612
2024-05-17 12:52:25 -07:00
Francis Tsui 5cddd51876 Remove use of dynamic_cast.
PiperOrigin-RevId: 634559729
2024-05-16 16:13:13 -07:00
Francis Tsui 1097288e54 Fix threading issues in NearbySharingServiceImpl.
PiperOrigin-RevId: 634527776
2024-05-16 14:22:48 -07:00
Francis Tsui 16f820471e Remove use of dynamic_cast from nearby/sharing.
PiperOrigin-RevId: 634519160
2024-05-16 13:57:01 -07:00
Francis Tsui 20c0c5aac3 Fix tsan issues.
PiperOrigin-RevId: 634212412
2024-05-15 22:30:37 -07:00
Anay Wadhera a6ec53dc1d Add OnShareTargetUpdated callback to NS C++
PiperOrigin-RevId: 633705421
2024-05-14 14:22:25 -07:00
Francis Tsui 7840f93181 Fix threading in NearbyFileHandler.
PiperOrigin-RevId: 633678194
2024-05-14 12:57:35 -07:00
Anay Wadhera e73727ea39 Create flag for delaying endpoint loss
PiperOrigin-RevId: 633663638
2024-05-14 12:06:15 -07:00
Will Harmon 12d03e75d3 Shrink the QR code
PiperOrigin-RevId: 633285268
2024-05-13 11:55:55 -07:00
Francis Tsui 78729abb7d Add method to track active users.
PiperOrigin-RevId: 632594799
2024-05-10 13:55:29 -07:00
Anay Wadhera f26d25ed01 Provide a platform abstraction for RandBytes instead of swapping headers
The `RandBytes` functions were being placed in the `crypto` namespace,
which collides with Chromium's namespace of the same name. Within,
`RandBytes` was defined with almost-the-same API. Then in Chromium
builds, the Chromium header would be used instead (though somewhat
inconsistently).

This creates a lot of pain for Chromium development as there's a
third-party repository directly depending on headers from Chromium's
source tree, and is against the third-party policies for that reason.
There are a number of other headers that mirror Chromium and are
swapped out in the Chromium build that will cause similar pain, such as:
```
include "crypto/aead.h"
include "crypto/ec_private_key.h"
include "crypto/hkdf.h"
```

This CL provides a template for how to get rid of these header swaps and
give a platform abstraction in nearby instead.

We provide a platform abstraction in `platform/crypto.h` (really in
`platform/implementation/crypto.h`) which is implemented in
`platform/implementation/shared/crypto.cc`. However that implementation
is removed by `#ifdef` when in the Chromium build.

Then, in the Chromium repo, we will add (separately) an implementation
of the same abstraction in `//third_party/nearby/platform_impl` with GN
rules to include it in the build. It will replace the implementation
from the nearby repo.

Copybara import of the project:

--
6ca8099 by danakj <danakj@chromium.org>:

Provide a platform abstraction for RandBytes instead of swapping headers

The `RandBytes` functions were being placed in the `crypto` namespace,
which collides with Chromium's namespace of the same name. Within,
`RandBytes` was defined with almost-the-same API. Then in Chromium
builds, the Chromium header would be used instead (though somewhat
inconsistently).

This creates a lot of pain for Chromium development as there's a
third-party repository directly depending on headers from Chromium's
source tree, and is against the third-party policies for that reason.
There are a number of other headers that mirror Chromium and are
swapped out in the Chromium build that will cause similar pain, such as:
```
include "crypto/aead.h"
include "crypto/ec_private_key.h"
include "crypto/hkdf.h"
```

This CL provides a template for how to get rid of these header swaps and
give a platform abstraction in nearby instead.

We provide a platform abstraction in `platform/crypto.h` (really in
`platform/implementation/crypto.h`) which is implemented in
`platform/implementation/shared/crypto.cc`. However that implementation
is removed by `#ifdef` when in the Chromium build.

Then, in the Chromium repo, we will add (separately) an implementation
of the same abstraction in `//third_party/nearby/platform_impl` with GN
rules to include it in the build. It will replace the implementation
from the nearby repo.

--
9c2654b by danakj <danakj@chromium.org>:

Remove CryptoSpan, use absl::Span

The header swapping of Chromium crypto libraries is
problematic, but absl::Span will convert to base::span
so there's no need for the typedef even without
removing the header swapping yet.

--
df1135d by danakj <danakj@chromium.org>:

Add missing files

--
ab18a15 by danakj <danakj@chromium.org>:

Remove the random_unittest.cc from Swift build

The file moved, so the Swift package needs its path
updated.

--
2038f78 by danakj <danakj@chromium.org>:

Combine crypto unittests into crypto_test.cc

--
f7ad176 by danakj <danakj@chromium.org>:

Add stdint and stddef includes for uint8_t and size_t

--
9f04590 by danakj <danakj@chromium.org>:

Mark the shared crypto implementation compatable_with non_prod

--
18eeafd by danakj <danakj@chromium.org>:

Add IWYU pragma for crypto implementation

PiperOrigin-RevId: 632150866
2024-05-09 08:02:50 -07:00
Francis Tsui 346999639c Remove use of ShareTarget from payload tracker.
PiperOrigin-RevId: 631211496
2024-05-06 15:56:37 -07:00
Francis Tsui dd7dbdf98d Remove unnecessary optional when processing endpoint_id.
PiperOrigin-RevId: 630416001
2024-05-03 09:46:48 -07:00
Francis Tsui d759708f53 Remove unnecessary passing of ShareTarget.
PiperOrigin-RevId: 630226988
2024-05-02 17:37:44 -07:00
Francis Tsui 8e3cfd04f8 Add tests for sharing_platform_base.
PiperOrigin-RevId: 629794040
2024-05-01 12:05:34 -07:00
Francis Tsui e532ee1b92 Internal change
PiperOrigin-RevId: 629183197
2024-04-29 14:15:45 -07:00
Francis Tsui 048e48e415 internal change
PiperOrigin-RevId: 628599038
2024-04-26 22:10:58 -07:00
Francis Tsui af59ff9794 internal changes.
PiperOrigin-RevId: 628561715
2024-04-26 18:14:26 -07:00
hai007 08c37823d0 Automated Code Change
PiperOrigin-RevId: 627971802
2024-04-24 23:38:50 -07:00
Francis Tsui 683b46488a Fix non hermetic test cases.
PiperOrigin-RevId: 627875242
2024-04-24 15:48:54 -07:00
Francis Tsui f1631fafe1 Fix TSAN errors.
PiperOrigin-RevId: 627186253
2024-04-22 16:12:55 -07:00
Francis Tsui ef924e5003 improve concurrency handling.
PiperOrigin-RevId: 626916898
2024-04-21 22:24:34 -07:00
Francis Tsui 1b4db47fb6 Remove wildcard lambda capture.
PiperOrigin-RevId: 626457708
2024-04-19 13:41:10 -07:00
Francis Tsui dbb6550c2f Remove experiments_log.proto.
PiperOrigin-RevId: 626095230
2024-04-18 11:23:46 -07:00
Francis Tsui 012b9b0569 Cleanup EventLogger interface.
PiperOrigin-RevId: 625797877
2024-04-17 13:59:30 -07:00
Eiden Kim 42f7afb940 Adjust flag setting for unknown file delete
PiperOrigin-RevId: 625671393
2024-04-17 07:11:53 -07:00
Eiden Kim 486b4bfaca Remove unknown files from PAYLOAD_TRANSFER offline frame
PiperOrigin-RevId: 625500482
2024-04-16 17:14:40 -07:00
Eiden Kim e5279bfd49 Don't upgrade bandwidth until the user accepts.
PiperOrigin-RevId: 625488273
2024-04-16 16:28:26 -07:00
Francis Tsui eb4337f1ea Change ownership model of NearbySharingEventLogger.
PiperOrigin-RevId: 625064926
2024-04-15 13:31:07 -07:00
Francis Tsui a8bf25d692 Create common MockEventLogger.
PiperOrigin-RevId: 624994414
2024-04-15 10:00:17 -07:00
Eiden Kim 63b12edb45 Add flags to nearby_sharing_feature_flags.h manually
PiperOrigin-RevId: 624970993
2024-04-15 08:36:56 -07:00
Francis Tsui f6b6ee0446 Fix TSAN errors.
PiperOrigin-RevId: 623943443
2024-04-11 14:39:28 -07:00