Commit Graph
259 Commits
Author SHA1 Message Date
hai007 2a43f74e1e Automated Code Change
PiperOrigin-RevId: 702190141
2024-12-02 21:33:29 -08:00
Nick Bourdakos 3caae8d58d Remove compatible_with from Bazel targets
PiperOrigin-RevId: 698102508
2024-11-19 12:19:39 -08:00
Nick Bourdakos 2786145f74 Fix proto imports for Fast Pair
PiperOrigin-RevId: 698083007
2024-11-19 11:21:06 -08:00
Francis Tsui b03a383f7a Trivial replacement of NEARBY_LOG with NEARBY_LOGS.
PiperOrigin-RevId: 667740113
2024-08-26 15:34:21 -07:00
hai007 f0115df88b Internal change
PiperOrigin-RevId: 663333107
2024-08-15 09:40:28 -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
hai007 f72ceedfd2 Automated Code Change
PiperOrigin-RevId: 628287046
2024-04-25 21:36:00 -07:00
hai007 540ebba9b4 Automated Code Change
PiperOrigin-RevId: 625953967
2024-04-18 01:49:36 -07:00
Francis Tsui 012b9b0569 Cleanup EventLogger interface.
PiperOrigin-RevId: 625797877
2024-04-17 13:59:30 -07:00
Francis Tsui a8bf25d692 Create common MockEventLogger.
PiperOrigin-RevId: 624994414
2024-04-15 10:00:17 -07:00
hai007 03f0b3dae9 Automated Code Change
PiperOrigin-RevId: 623732541
2024-04-11 00:29:33 -07:00
Nick Bourdakos a08a42077c PR #2404: Add license header to all source files
Imported from GitHub PR https://github.com/google/nearby/pull/2404

Copybara import of the project:

--
a6fbb3c396321c0b9012b787323f5f2ff652fd8f by Nick Bourdakos <bourdakos1@gmail.com>:

Add license header to all source files

Merging this change closes #2404

PiperOrigin-RevId: 623540004
2024-04-10 10:40:38 -07:00
hai007 5193a40b24 Automated Code Change
PiperOrigin-RevId: 622367955
2024-04-05 21:56:21 -07:00
hai007 2a56254756 Automated Code Change
PiperOrigin-RevId: 621908243
2024-04-04 10:52:30 -07:00
hai007 d6a6b7e1c3 Automated Code Change
PiperOrigin-RevId: 621745483
2024-04-03 23:18:34 -07:00
hai007 419fb08a8f Internal change
PiperOrigin-RevId: 621013420
2024-04-01 19:01:59 -07:00
Francis Tsui a082f36021 Switch glog to absl::log.
PiperOrigin-RevId: 615535748
2024-03-13 14:03:23 -07:00
hai007 cf2a1eb0b1 Internal change
PiperOrigin-RevId: 613133183
2024-03-06 10:21:45 -08:00
Francis Tsui d15f533721 Cleanup BUILD dependencies.
PiperOrigin-RevId: 609511614
2024-02-22 15:05:13 -08:00
Francis Tsui c2ade33c9c No public changes.
PiperOrigin-RevId: 597033150
2024-01-09 13:46:42 -08:00
Francis Tsui 63e744e133 Finish migrating account_manager.h to new location.
PiperOrigin-RevId: 592074168
2023-12-18 19:11:52 -08:00
Francis Tsui 32740f8591 Move FakeAccountManager to nearby/internal/test
PiperOrigin-RevId: 592055356
2023-12-18 17:30:16 -08:00
Francis Tsui cf69c87d95 Cleanup FakeAccountManager.
- Remove unnecessary deps.

PiperOrigin-RevId: 591964328
2023-12-18 11:41:24 -08:00
Qin Wang 0e7fc8d429 Disable flaky test //third_party/nearby/fastpair/internal:fast_pair_seeker_impl_test
PiperOrigin-RevId: 590018163
2023-12-11 18:31:53 -08:00
Copybara-Service ac887e55a9 Merge pull request #2125 from google:dependabot/pub/fastpair/rust/demo/archive-3.3.8
PiperOrigin-RevId: 572967743
2023-10-12 11:38:39 -07:00
Anay Wadhera 0d8ffabe08 Lock flutter_rust_bridge to 1.80.1 2023-10-12 05:03:19 +00:00
Qin Wang 264aa3829f Disable flaky test//third_party/nearby/fastpair/scanning:scanner_broker_impl_test
PiperOrigin-RevId: 570749393
2023-10-04 11:17:59 -07:00
Janusz Sobczak b33c0e0332 Migrate to AnyInvocable in auth module
Merged success/failure callbacks into a single callback
in SignInCallback and AccessTokenCallback to simplify resource management and to avoid making copies.

PiperOrigin-RevId: 565744310
2023-09-15 12:11:50 -07:00
dependabot[bot] 8b20e22414 Bump archive from 3.3.7 to 3.3.8 in /fastpair/rust/demo
Bumps [archive](https://github.com/brendan-duncan/archive) from 3.3.7 to 3.3.8.
- [Changelog](https://github.com/brendan-duncan/archive/blob/main/CHANGELOG.md)
- [Commits](https://github.com/brendan-duncan/archive/compare/3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: archive
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-15 17:22:19 +00:00
Lucas Silva Shepard 22e7900bb3 [fp-rs] Fixing Presubmit linter issues for autogenerated Flutter code. 2023-08-18 20:12:00 -07:00
Lucas Silva Shepard 02e9cda698 [fp-rs] Comment cleanup. 2023-08-18 19:56:55 -07:00
Lucas Silva Shepard 5f255f1ff5 [fp-rs] Fixing build warnings by removing or annotating unused imports. 2023-08-18 18:11:16 -07:00
Lucas Silva Shepard 90812bfe73 [fp-rs] Making some values const rather than static or inlined. 2023-08-18 17:49:34 -07:00
Lucas Silva Shepard d89d1af459 [fp-rs] Added custom FP error type to Rust code. 2023-08-18 17:49:31 -07:00
Lucas Silva Shepard fb95e26bf5 [fp-rs] Added FP Advertisement unit tests in Rust. 2023-08-15 16:44:48 -07:00
Lucas Silva Shepard 169c04c430 [fp-rs] Split fetcher.rs into directory module, added mock. 2023-08-15 16:44:46 -07:00
Lucas Silva Shepard b1fa76f560 [fp-rs] Wrote unit tests for Fast Pair Decoder in Rust. 2023-08-15 16:44:04 -07:00
Lucas Silva Shepard 748bf9fb18 [fp-rs] Added unit tests to cover common portion of Rust Bluetooth library. 2023-08-15 16:44:04 -07:00
Copybara-Service 59add37c96 Merge pull request #2027 from TheShepord:fpwinrs_flutter
PiperOrigin-RevId: 557279903
2023-08-15 16:03:40 -07:00
Lucas Silva Shepard bdc109324b [fp-rs] Fixing Presubmit Lint warnings for windows/ C++ files. 2023-08-15 15:24:33 -07:00
Lucas Silva Shepard 41be4cca57 [fp-rs] Adding copyright notice under windows/ and bindgen files. 2023-08-15 14:36:39 -07:00
Lucas Silva Shepard f2326f107e [fp-rs] Removing unused macOS, iOS, Android, web and Linux builds. These can be re-added in the future as needed. 2023-08-15 14:00:51 -07:00
Lucas Silva Shepard 3379d0ca3e [fp-rs] Providing second device JSON to test multi-device setup. 2023-08-14 13:36:24 -07:00
Lucas Silva Shepard a683ed6789 [fp-rs] Added device dismissing functionality. The Seeker will ignore a dismissed device's advertisements until a 10s timeout expires. 2023-08-14 13:33:46 -07:00
Lucas Silva Shepard 57373a80c3 [fp-rs] Displaying device image retrieved from model ID. 2023-08-14 13:33:44 -07:00
Lucas Silva Shepard 329e1b298e [fp-rs] Retrieving device information from model ID by parsing local file with serde. 2023-08-14 13:32:25 -07:00
Lucas Silva Shepard a57b55ad98 [fp-rs] Now using model ID instead of BLE address for keeping track of unique devices. 2023-08-14 13:32:22 -07:00
Lucas Silva Shepard f8fb8d4b52 [fp-rs] Flutter UI now only displays the closest discovered device. 2023-08-13 16:52:28 -07:00
Lucas Silva Shepard 0505a23b3f [fp-rs] Added bluetooth pairing button, result displayed in alert dialog. 2023-08-13 16:52:28 -07:00
Lucas Silva Shepard bf05ab5db4 [fp-rs] Invoking Rust code from Dart, retrieving stream of incoming bluetooth advertisements. 2023-08-13 16:52:26 -07:00