Commit Graph
94 Commits
Author SHA1 Message Date
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
Anay Wadhera b0e5b059d9 Internal upgrade
PiperOrigin-RevId: 513590478
2023-03-02 11:20:57 -08:00
Janusz Sobczak bb0ccf9156 Verify LDT with test data from android tests
PiperOrigin-RevId: 513093397
2023-02-28 18:12:03 -08:00
Janusz Sobczak 4f21a570e4 Add ParseAndroidSharedCredential test
PiperOrigin-RevId: 509588875
2023-02-14 11:31:37 -08:00
Suet-Fei Li 00f86cde7b Do not build Rust for Windows & Android platforms.
PiperOrigin-RevId: 509133994
2023-02-12 23:07:20 -08:00
Janusz Sobczak da723cfaa6 Remove usages of Metadata::device_id
PiperOrigin-RevId: 508465243
2023-02-09 13:48:17 -08:00
Anay Wadhera dc8b1ef7ee Expose internal/platform windows implementation to presence and add bcrypt.lib for resolving bcrypt symbols in absl
PiperOrigin-RevId: 507834078
2023-02-07 11:13:38 -08: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 2746a4aa2f Fix field sizes in credentials
authenticity_key must be 32 bytes. metadata_encryption_key must be 14 bytes.

PiperOrigin-RevId: 505183908
2023-01-27 12:34:51 -08:00
Janusz Sobczak 94e70d0ddd Store consumed salts in private credentials
PiperOrigin-RevId: 505167378
2023-01-27 11:30:54 -08:00
Janusz Sobczak eb282a64da Set credential start&end times
PiperOrigin-RevId: 504880260
2023-01-26 10:33:22 -08:00
Anay Wadhera c58b45eb50 Rename PublicCredential to SharedCredential and PrivateCredential to LocalCredential
PiperOrigin-RevId: 503221477
2023-01-24 12:09:21 -08:00
Anay Wadhera 43ec97b13b Add missing die_if_null.h include
PiperOrigin-RevId: 503504149
2023-01-20 12:55:38 -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 ca547df4d7 Subscribe for public credentials update
Nearby Presence scanning sessions may be very long. We need a way to notify the scanner that new credentials were added during scanning.
`SubscribeForPublicCredentials()` allows us to subscribe for such updates.

PiperOrigin-RevId: 502699345
2023-01-17 15:07:14 -08:00
Anay Wadhera 44fb63f498 Use CredentialSelector for GenerateCredentials()
PiperOrigin-RevId: 501951868
2023-01-13 15:23:35 -08:00
Janusz Sobczak 0e2111afc2 Collapse success&failure callbacks into one
Instead of two callbacks:
- void on_success(Result result)
- void on_failure(Status status)
use just one callback:
void on_result(StatusOr<Result> result)

PiperOrigin-RevId: 501912034
2023-01-13 12:28:47 -08:00
Anay Wadhera 7667420e2b Use CredentialSelector for GenerateCredentials()
PiperOrigin-RevId: 501622339
2023-01-12 11:36:37 -08:00
Suet-Fei Li 084f7ebd88 Remove location namespace in third_party/nearby.
PiperOrigin-RevId: 500023196
2023-01-06 02:53:57 -08:00
Anay Wadhera 7afea00649 Internal change
PiperOrigin-RevId: 499997190
2023-01-06 02:49:53 -08:00
Janusz Sobczak e64f9859e1 Replace BleOperationStatus with absl::Status
PiperOrigin-RevId: 497191477
2022-12-22 10:20:15 -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 b3f8534226 Use Rand instead of absl::Random
Use Nearby's common Rand() util instead of absl::Random

PiperOrigin-RevId: 495386054
2022-12-14 12:30:56 -08:00
Anay Wadhera 228e52e979 Refactor broadcasting code into BroadcastManager
PiperOrigin-RevId: 495021310
2022-12-13 07:57:04 -08:00
Janusz Sobczak 337e1f41b0 Clarify CredentialStorage interface.
SaveCredentials does not to return the credentials that it has just saved. Returning a status will do.
Improved documentation.

PiperOrigin-RevId: 494280108
2022-12-09 15:41:12 -08:00
Janusz Sobczak 0fb81f2b27 Enable LDT by default
PiperOrigin-RevId: 494227035
2022-12-09 11:50:36 -08:00
Janusz Sobczak 5ce2485694 Replace .proto.h with .pb.h
We should be using public .pb.h files

PiperOrigin-RevId: 494011872
2022-12-08 15:32:02 -08:00
Janusz Sobczak a92abac83a Update advertisement encoder/decoder
1. Update the API to accept the credentials on input instead of credential manager.
2. Update the test with values using the LDT encryption.

These changes allow us to have a more asynchronous implementaion.
When broadcasting we can:
1. Fetch the private credentials asynchronously.
2. Create the advertisement and start broadcasting when the credentials have been fetched.

When scanning we can:
1. Fetch public credentials asynchronously.
2. Start scanning for advertisements.
3. Update the decoder when new credentials are fetched.

PiperOrigin-RevId: 493998041
2022-12-08 14:36:44 -08:00
Anay Wadhera 87c57534a4 Include check.h header to fix Github presence build
PiperOrigin-RevId: 493067786
2022-12-05 11:43:05 -08:00
Anay Wadhera 40e391b33d Explicitly convert absl::string_view to std::string
PiperOrigin-RevId: 492260785
2022-12-01 12:01:09 -08:00
Janusz Sobczak 3aa109a29b Add NoDeviceFoundAfterStopScan test
PiperOrigin-RevId: 492260183
2022-12-01 11:57:13 -08:00
Anay Wadhera 109458b7ad Add missing header to service_controller.h
PiperOrigin-RevId: 492193352
2022-12-01 07:44:48 -08:00
Janusz Sobczak 255bdb6139 Add StopScan method.
Add StopScan and refactor StartScan to return a sesssion id.
Move handling of StartScan, StopScan and NotifyFoundBle to the same thread to avoid race conditions.
Implement start advertising in service controller.

PiperOrigin-RevId: 492016697
2022-11-30 14:21:26 -08:00
Anay Wadhera fb544f7900 Add missing headers to service_controller_impl.h to fix Chrome
PiperOrigin-RevId: 491969884
2022-11-30 11:17:49 -08:00
Janusz Sobczak e44f7eac61 Aynchronous start and stop broadcast
PiperOrigin-RevId: 491772964
2022-11-29 16:59:41 -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
Hai Shang 6871b9d5a6 Add initial impl for UpdateRemotePublicCredentials in CredentialManager.
PiperOrigin-RevId: 491458184
2022-11-28 15:24:26 -08:00
Janusz Sobczak 8bd3d34580 Link with Rust NP LDT
Add conditional dependency on Rust NP LDT.
By default, we will use an empty stub.

PiperOrigin-RevId: 490554102
2022-11-23 11:55:52 -08:00
Anay Wadhera 52d81710a2 Add fields to PresenceDevice
PiperOrigin-RevId: 490345719
2022-11-22 15:03:09 -08:00
Janusz Sobczak 9e61866ee3 Sync with Rust LDT changes
PiperOrigin-RevId: 490288278
2022-11-22 11:16:21 -08:00
Janusz Sobczak a3b6058753 Fully qualify ::location::nearby imports.
Find and replace exercise.
Replace
`using location::nearby`
with
`using ::location::nearby`
and
`using <Name> = location::nearby`
with
`using <Name> = ::location::nearby`

PiperOrigin-RevId: 490087051
2022-11-21 15:33:21 -08:00
Janusz Sobczak a11733988f Implement start advertising in service controller.
PiperOrigin-RevId: 489584407
2022-11-18 16:17:55 -08:00
Anay Wadhera beb67fc02a Call StopScan() when ScanSession goes out of scope and make sure stop can only be called once.
PiperOrigin-RevId: 488717591
2022-11-15 11:46:34 -08:00
Anay Wadhera b7de5f4097 Resolve unique_ptr being thrown away and potential deadlock issue
PiperOrigin-RevId: 487979164
2022-11-11 20:30:27 -08:00
Nick Bourdakos 4fb6ba318c Internal change
PiperOrigin-RevId: 486691317
2022-11-07 09:59:14 -08:00