Commit Graph
1493 Commits
Author SHA1 Message Date
Qin Wang 2c70aababf Add FastPairMediator
PiperOrigin-RevId: 520437860
2023-03-29 14:09:43 -07:00
Nick Bourdakos c73ebe8778 Add import comments
PiperOrigin-RevId: 520433728
2023-03-29 13:55:46 -07:00
Janusz Sobczak 94630e75ea Promote FpDevice to a class
PiperOrigin-RevId: 520430547
2023-03-29 13:51:11 -07:00
Janusz Sobczak c249c3079f Support fake clock in test environment
A synthetic clock helps testing (long) timeouts by allowing us to move the time
forward by an arbitrary amount.

PiperOrigin-RevId: 520407442
2023-03-29 12:19:28 -07:00
Guogang Li 5b94880740 Fixed some logic issues to handle BLE v2 advertisement
PiperOrigin-RevId: 520406643
2023-03-29 12:15:37 -07:00
hai007 4b4e599ea6 Add connection's SafeDisconnectionResult into the established connection so we could analyzing any mis-matched SafeDisconnectionResult with the same connection token.
PiperOrigin-RevId: 520398868
2023-03-29 11:49:08 -07:00
hai007 865637024d internal change
PiperOrigin-RevId: 520392632
2023-03-29 11:27:52 -07:00
Qin Wang a62000d3a8 Add g3 platform/medium_Environment for GattConnection
PiperOrigin-RevId: 520387265
2023-03-29 11:10:07 -07:00
Qin Wang 564bca0a85 Refactor unit test for fast pair scanner and add mock_scanner_broker
PiperOrigin-RevId: 520386239
2023-03-29 11:06:04 -07:00
Nick Bourdakos 64ff0ee034 Comment protos
PiperOrigin-RevId: 520349919
2023-03-29 09:00:08 -07:00
Nick Bourdakos a933a91413 Internal Change
PiperOrigin-RevId: 520165614
2023-03-28 16:26:40 -07:00
Qin Wang ec0944a61b Add GetFastPairVersion to DeviceMetadata
PiperOrigin-RevId: 520094589
2023-03-28 12:03:52 -07:00
Guogang Li b25314c34c Checked whether support BLE extended advertisement
PiperOrigin-RevId: 519848480
2023-03-27 15:41:38 -07:00
Hai Shang e3eacbddad internal clean up
PiperOrigin-RevId: 519840964
2023-03-27 15:12:44 -07:00
hai007 8c4489d0f9 Fix fast_pair_log to generate fast_pair_log.pb.h file.
PiperOrigin-RevId: 519802479
2023-03-27 12:50:42 -07:00
Guogang Li 9130b61f15 Only handle possible advertising advertising packet for BLE V2
PiperOrigin-RevId: 519292612
2023-03-24 19:23:09 -07:00
hai007 e64dcb40c8 Implement Fast Pair presenter for creating and managing UI component with Notification Controller.
PiperOrigin-RevId: 519237240
2023-03-24 14:23:32 -07:00
Nick Bourdakos 4ff3464679 Internal change
PiperOrigin-RevId: 519219499
2023-03-24 13:14:42 -07:00
Nick Bourdakos decdc15402 Internal change
PiperOrigin-RevId: 519204238
2023-03-24 12:06:55 -07:00
Nick Bourdakos 99298444df Use @rules_cc for cc_proto_library
PiperOrigin-RevId: 519188761
2023-03-24 12:05:19 -07:00
Nick Bourdakos e21f736588 Internal change
PiperOrigin-RevId: 519180519
2023-03-24 11:05:33 -07:00
Nick Bourdakos b5787017cf Add a PR template
PiperOrigin-RevId: 519160041
2023-03-24 09:16:15 -07:00
Qin Wang fd955d864f Add FakeFastPairDataEncryptor to help unit test FastPairHandshake
PiperOrigin-RevId: 518967535
2023-03-23 14:44:42 -07:00
hai007 f2331cfb42 Clean up build file.
PiperOrigin-RevId: 518966242
2023-03-23 14:40:43 -07:00
Janusz Sobczak 4bd7da967a Add MessageStream fuzzing test
PiperOrigin-RevId: 518920458
2023-03-23 11:41:39 -07:00
Aaron Yu e232149008 Add catch(...) exceptions to catch unknown exceptions in NC bluetooth adapter
PiperOrigin-RevId: 518902703
2023-03-23 10:43:07 -07:00
Anay Wadhera 3f1b0c81e3 Weave port [2/n]: Introduce Weave packetizer implementation
PiperOrigin-RevId: 518881931
2023-03-23 09:30:55 -07:00
Janusz Sobczak dbd31508fa Add medium fuzzing tests
PiperOrigin-RevId: 518722768
2023-03-22 18:08:09 -07:00
Janusz Sobczak adcb341190 Verify that IO on closed socket returns an error
The test implementation of BluetoothSocket::GetInputStream() would crash if
the socket was closed. That's not ideal because the caller can't verify if the
socket is open or closed.

New test verifies that GetOutputStream() and GetInputStream() always return a
valid reference.

PiperOrigin-RevId: 518722540
2023-03-22 18:04:12 -07:00
Janusz Sobczak 1a78b33a89 Add InputStream::ReadExactly
Read() can return fewer bytes than requested.
ReadExactly() will call Read() repeatedly until we
have read as many bytes as we need.

PiperOrigin-RevId: 518719418
2023-03-22 17:45:50 -07:00
Nick Bourdakos ebf87cc581 Update issue template
PiperOrigin-RevId: 518676538
2023-03-22 14:40:04 -07:00
Aaron Yu 59fc030843 Harden NC bluetooth adapter with try catch exceptions
PiperOrigin-RevId: 518664644
2023-03-22 13:55:27 -07:00
Nick Bourdakos 87af84cddd Add issue templates
PiperOrigin-RevId: 518658906
2023-03-22 13:33:59 -07:00
Anay Wadhera abeabc3911 Add PresenceAction vector to PresenceDevice
PiperOrigin-RevId: 518650656
2023-03-22 13:03:44 -07:00
Nick Bourdakos cbf50a3d49 Add more visibilities
PiperOrigin-RevId: 518647351
2023-03-22 12:51:23 -07:00
Anay Wadhera 5fadbd2388 Add property vector to PresenceDevice
PiperOrigin-RevId: 518645129
2023-03-22 12:42:46 -07:00
Nick Bourdakos 0b3c759aa3 Remove unneeded WebRTC flags
PiperOrigin-RevId: 518629654
2023-03-22 11:44:12 -07:00
hai007 8b1791caab Automated visibility attribute cleanup.
PiperOrigin-RevId: 518628538
2023-03-22 11:39:32 -07:00
hai007 548b51f331 Add MagicPairLog and magic_pair_enums to third_party.
PiperOrigin-RevId: 518603122
2023-03-22 10:16:24 -07:00
Nick Bourdakos ec025502dc Refactor WebRTC code to avoid use of select for stubs
PiperOrigin-RevId: 518491132
2023-03-22 00:25:54 -07:00
Janusz Sobczak b2da1efbbf Parse events from message stream.
Adds parsing for standard events, everything except audio switch.

PiperOrigin-RevId: 518425430
2023-03-21 17:23:42 -07:00
hai007 72ac6e8df0 Add new SETUP_WIZARD event to Nearby Sharing analytics.
PiperOrigin-RevId: 518363414
2023-03-21 13:29:52 -07:00
Nick Bourdakos 39df20d821 Internal change
PiperOrigin-RevId: 518186148
2023-03-20 23:51:16 -07:00
Guogang Li 78145f4433 Fixed crash during devices scanning
PiperOrigin-RevId: 518127975
2023-03-20 18:03:49 -07:00
hai007 d0b258971d Remove the coroutines workaround from Nearby and drop experimental/coroutines.
In Prod LLVM release branch 515643669.1 ( cl/517696539 ) the experimental coroutines implementation is dropped. The `experimental/coroutines` header is removed.

Nearby doesn't use coroutines, but it uses libraries that depend on the existence of coroutine function definitions. Specifically, WinRT needs certain coroutine function definitions in order to compile.

Ordinarily, WinRT relied on the coroutine function definitions provided in the MSVC STL' `experimental/coroutines` header. The introduction of libc++ complicated this dependency for Nearby, because libc++' `experimental/coroutines` header took the place of the MSVC version, and (correctly, for C++17) provided none of the coroutine function definitions.

To resolve these issues, we implemented a patch of WinRT. The patch provided placeholder definitions, which allowed WinRT to pass compilation. This patch was submitted in cl/495104919. The patch was necessary to enable the Nearby migration from MSVC STL to libc++.

--

The removal of `experimental/coroutines` from libc++ makes this patch unnecessary. However, the patch will not compile without libc++' `experimental/coroutines` header.

The presence of libc++' `experimental/coroutines` header had prevented the corresponding MSVC STL' header from defining the functions for which the patch makes placeholders. Without the libc++' `experimental/coroutines` header, the MSVC STL header is employed and makes these definitions. The patch then redefines these functions, which causes a compilation failure.

--

This CL makes two changes: 1) It eliminates the patch, and 2) It eliminates the libc++ `experimental/coroutines` file from the Lexan libc++ distribution. This allows Nearby to function identically before and after the release of Lexan 515643669.1.

This change prevents a break from occurring when Lexan 515643669.1 is released.

PiperOrigin-RevId: 518119913
2023-03-20 17:20:47 -07:00
Janusz Sobczak a7a3eb8a92 Use consistent return value in Pipe read.
Previously reading from an empty, closed Pipe returned:
* IO exception if there were no writes to the pipe,
* Empty byte array if there were writes to the pipe.
With this change, we return an empty byte array on both paths.

This also fixes a subtle race condition in the following flow:
1. Pipe is empty
2. Thread A is reading from the pipe (blocking call).
3. Thread B writes to the pipe and immediately closes it.
4. Thread A is unblocked and returns IO error. The data written by thread B is
   ignored!

The new test in bluetooth_classic_test triggered that defect consistently.

PiperOrigin-RevId: 518107700
2023-03-20 16:26:52 -07:00
hai007 903fa9817c Add logging of impressions to Nearby Share setup wizard screen.
PiperOrigin-RevId: 518085655
2023-03-20 15:00:24 -07:00
Nick Bourdakos 57dd89c34c Internal change
PiperOrigin-RevId: 518076706
2023-03-20 14:27:22 -07:00
Janusz Sobczak e202af3ccc Add value parameter to future listeners
Pass the Future result to listeners as a parameter.
This makes the AddListener() API a bit more convenient.

PiperOrigin-RevId: 518040156
2023-03-20 12:15:47 -07:00
Nick Bourdakos ced4369202 Fix README link typo
PiperOrigin-RevId: 518024831
2023-03-20 11:24:20 -07:00