Commit Graph
545 Commits
Author SHA1 Message Date
Anay Wadhera df166289bb internal change
PiperOrigin-RevId: 667781323
2024-08-26 18:04:45 -07:00
Francis Tsui b03a383f7a Trivial replacement of NEARBY_LOG with NEARBY_LOGS.
PiperOrigin-RevId: 667740113
2024-08-26 15:34:21 -07:00
Guogang Li 2c700115ef internal fix
PiperOrigin-RevId: 666482118
2024-08-22 14:08:02 -07:00
Suet-Fei Li a81ce57879 Support 3P oauth flow.
PiperOrigin-RevId: 663964316
2024-08-16 19:39:13 -07:00
hai007 f0115df88b Internal change
PiperOrigin-RevId: 663333107
2024-08-15 09:40:28 -07:00
Guogang Li 25eec0ff0f Fixed some test issues
PiperOrigin-RevId: 662722512
2024-08-13 18:18:52 -07:00
Guogang Li cad1ef6bf3 Fixed a bug in GATT client
PiperOrigin-RevId: 662666561
2024-08-13 15:05:47 -07:00
Guogang Li 9378752513 internal update
PiperOrigin-RevId: 661390542
2024-08-09 13:49:58 -07:00
Francis Tsui 0740e5fba5 internal changes
PiperOrigin-RevId: 661115479
2024-08-08 21:53:52 -07:00
Anay Wadhera b0f58ee5a0 Deprecate kCheckIllegalCharacters flag.
PiperOrigin-RevId: 660433186
2024-08-07 10:05:50 -07:00
Francis Tsui d56c1008cd Enable platform tests for Windows builds.
PiperOrigin-RevId: 658892575
2024-08-02 13:41:44 -07:00
Francis Tsui 1ee946429b Fix CreateAtomic* on Windows platform.
PiperOrigin-RevId: 658667651
2024-08-01 22:35:36 -07:00
Francis Tsui f2d591e045 Split test targets that can run on windows.
PiperOrigin-RevId: 658619600
2024-08-01 19:13:47 -07:00
Francis Tsui b55ea69464 Add credential_error flag on Logout notification.
PiperOrigin-RevId: 658500314
2024-08-01 12:36:13 -07:00
Guogang Li 4d457d134b Fixed one GATT crash
PiperOrigin-RevId: 657684638
2024-07-30 12:13:51 -07:00
Guogang Li 9413448e6e Fixed a crash in task scheduler
PiperOrigin-RevId: 657213567
2024-07-29 08:45:07 -07:00
hai007 9ea22bb1e4 Automated Code Change
PiperOrigin-RevId: 655112620
2024-07-23 04:24:22 -07:00
Guogang Li 52c80303e3 Enhance on advertising
PiperOrigin-RevId: 655044204
2024-07-22 23:57:16 -07:00
Guogang Li d576caa4f3 Internal API fix
PiperOrigin-RevId: 653475092
2024-07-17 22:02:13 -07:00
Guogang Li 304a0e2851 Add more logs for GATT advertising
PiperOrigin-RevId: 653282565
2024-07-17 10:35:57 -07:00
Guogang Li f2724e85f2 Apply task scheduler
PiperOrigin-RevId: 653046912
2024-07-16 18:17:56 -07:00
Anay Wadhera 01e9a6e0e2 internal fix
PiperOrigin-RevId: 652927652
2024-07-16 11:57:29 -07:00
Guogang Li d30f53f92b Added a class to schedule multiple tasks
PiperOrigin-RevId: 652871095
2024-07-16 09:20:24 -07:00
Guogang Li 0f4f02c7f0 Internal crash fix
PiperOrigin-RevId: 651635619
2024-07-11 21:25:06 -07:00
Guogang Li 32cee3439b Pause Bluetooth classic discovery
PiperOrigin-RevId: 647333108
2024-06-27 08:52:58 -07:00
Guogang Li 0640832025 Allowed G3 to simulated BLE device supported extended advertisement
PiperOrigin-RevId: 646503301
2024-06-25 09:20:58 -07:00
Guogang Li 7ccbfef89b internal fix
PiperOrigin-RevId: 644430280
2024-06-18 10:20:18 -07:00
Crisrael Lucero acc38a809b [Nearby Presence] Update ScanManager to trigger changed and lost events
PiperOrigin-RevId: 644072733
2024-06-17 11:17:00 -07:00
Francis Tsui 3d2adf8b42 internal changes.
PiperOrigin-RevId: 642056854
2024-06-10 16:20:30 -07:00
Edwin Wu 152cabab7c Fix a bug in file payload.
PiperOrigin-RevId: 640494382
2024-06-05 05:43:02 -07:00
hai007 a2d018cd87 Add nullability annotation
PiperOrigin-RevId: 637062647
2024-05-24 16:19:04 -07:00
Eiden Kim dca2997f5d Added more checks to file path validation.
PiperOrigin-RevId: 635580793
2024-05-20 15:03:50 -07:00
Eiden Kim b224f8660c Check illegal characters from the file and parent folder name
PiperOrigin-RevId: 634941778
2024-05-17 18:46:26 -07:00
Eiden Kim 33d66fd169 Check illegal characters from the file and parent folder name
PiperOrigin-RevId: 634598623
2024-05-16 18:54:45 -07:00
Anay Wadhera 4aa73df657 Internal changes for stub impl
PiperOrigin-RevId: 634082976
2024-05-15 14:49:33 -07:00
Anay Wadhera fcc08df58b internal change
PiperOrigin-RevId: 634077236
2024-05-15 14:31:46 -07:00
hai007 556a026a6e Automated Code Change
PiperOrigin-RevId: 633055418
2024-05-12 18:49:35 -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
Ryan Hansberry cc84b6f4a4 Make credential refill asynchronous
Fixes a ChromeOS-deadlock during credential refill. The
previous logic blocked the IO thread that ChromeOS is using
to listen for responses from its CredentialStorage layer,
thus preventing it from signaling the latch.

Given that CheckCredentialsAndRefillIfNeeded is meant to
be async (given its continuation-passing style), this CL
avoids any thread trickiness by removing any latch-waiting
within the function. The nice side-effect of this is breaking
up the function into 3 smaller functions, which should
hopefully make it a bit more readable.

//.../g3/credential_storage_impl.cc has its mutex locks
removed -- they otherwise cause deadlocks, and are now
unnecessary.

This CL introduces a CHECK_EQ to ensure that the number of
remaining valid (not-expired) credentials is equal across the
shared and local list. This actually exposed a bug in the
credential_manager_impl_test.cc -- the test was only expiring
a public credential, and not its corresponding private credential.
Thus, the test is also updated in this CL to correctly mark
the first credential of the shared and local list as expired.

PiperOrigin-RevId: 631822135
2024-05-08 09:14:53 -07:00
Hai Shang 17df967296 replace secrect_id to id inside presence credential manager
PiperOrigin-RevId: 630558485
2024-05-03 19:28:48 -07:00
hai007 19adc300a0 Automated Code Change
PiperOrigin-RevId: 627267684
2024-04-22 22:39:50 -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
Edwin Wu 78505e91f7 Add the privacy manifests for swift NC-SDK.
PiperOrigin-RevId: 623676227
2024-04-10 19:19:11 -07:00
hai007 c198af1495 Automated Code Change
PiperOrigin-RevId: 623376075
2024-04-09 22:14:22 -07:00
Francis Tsui 8d41593056 Internal changes.
PiperOrigin-RevId: 623002360
2024-04-08 17:56:34 -07:00
hai007 2a56254756 Automated Code Change
PiperOrigin-RevId: 621908243
2024-04-04 10:52:30 -07:00
Francis Tsui d33c8c6aef Fix preference file loading bug.
PiperOrigin-RevId: 621604205
2024-04-03 12:27:51 -07:00
hai007 80570e55b0 Automated Code Change
PiperOrigin-RevId: 620702020
2024-03-31 16:16:32 -07:00
Francis Tsui 1e08b2d886 Fixed remaining filesystem calls that throws exceptions.
PiperOrigin-RevId: 620379472
2024-03-29 17:33:25 -07:00
Guogang Li 387a51b260 internal update
PiperOrigin-RevId: 619595164
2024-03-27 11:25:55 -07:00