Commit Graph
92 Commits
Author SHA1 Message Date
Pu Shi 643c0efdde [Nearby Connections] Add methods to shutdown executors in bwu_manager
Adding methods that allow us to shutdown executors in bwu_manager
during Nearby Connections shutdown process to prevent potential crashes.

PiperOrigin-RevId: 466425604
2022-08-09 11:57:38 -07:00
guogang 9b12bdde8d Fixed the crash in connection close event
PiperOrigin-RevId: 465657456
2022-08-05 15:14:13 -07:00
jfcarroll 5b3d443815 Remove the call to Toggle from the BluetoothRadio destructor. https://buganizer.corp.google.com/issues/237492358
PiperOrigin-RevId: 465451962
2022-08-04 18:22:51 -07:00
jfcarroll 778c77eacd Persist the original radio name, and restore it on app start if the radio name is our radio name.
PiperOrigin-RevId: 464148898
2022-07-29 13:43:35 -07:00
hai007 ef014d47b8 Disable encryption for HOTSPOT
PiperOrigin-RevId: 463773343
2022-07-28 00:51:47 -07:00
hai007 d41cd674c8 Add onSessionComplete method in ClientProxy to log session
PiperOrigin-RevId: 461772377
2022-07-18 19:17:19 -07:00
xlythe 859a0ecb27 Add USB enum
PiperOrigin-RevId: 461149613
2022-07-15 01:49:46 -07:00
hai007 e4a0f280e2 BWU Hotspot Responder(client) need to disconnect Hotspot when the session is done
PiperOrigin-RevId: 460577462
2022-07-12 16:23:48 -07:00
hai007 0a7f68f382 Cap the output stream package size to kMaxAllowedReadBytes, which is 1048576
PiperOrigin-RevId: 459622727
2022-07-07 16:00:19 -07:00
edwinwu 12dcd319e0 [BLE Refactor] Implement iOS BLE outgoing(request) connection.
PiperOrigin-RevId: 459381179
2022-07-06 17:13:14 -07:00
hai007 7e081c663a Add dump function to nearby connections.
Sample output:
```
Time: 2022-06-23T17:24:14.3815934+00:00
Windows version: 10.0 build 19042
NearbyShare version: 1.2.3.4
Nearby Share Settings
  Device name: Deling's PC
  Visibility: 1
  Enabled: 1
  ShowNotification: 0
  DataUsage: 0
  Allowed contacts:
Nearby Sharing Service state
  IsScanning: 0
  IsConnecting: 0
  IsTransferring: 0
  IsSendingFile: 0
  IsReceivingFile: 0
Nearby Connections State
  Client ID: -5841239073452700193
  Local Endpoint ID: IWV0
  High Vis Mode: 0
  Is Advertising: 0
  Advertising Service ID:
  Is Discovering: 0
  Discovery Service ID:
  Connections:
  Discovered endpoint IDs:
```
PiperOrigin-RevId: 458066027
2022-06-29 14:33:41 -07:00
hai007 407222b104 Fix a BWU revert logic error for BWU initiator
PiperOrigin-RevId: 457799119
2022-06-28 12:58:33 -07:00
edwinwu 9ce81d8534 [BLE Refactor] Implement iOS BLE incoming connection.
PiperOrigin-RevId: 457110588
2022-06-24 15:58:47 -07:00
johnsonlu ce80804639 Modify the comment of MediumMetaData.ap_frequency
PiperOrigin-RevId: 455297318
2022-06-15 22:19:39 -07:00
hai007 a9d7061794 Group Connection Info into structure
PiperOrigin-RevId: 454663252
2022-06-13 11:49:53 -07:00
hai007 2d4cc75dfa Fix miscellaneous typos in the comments or logging.
PiperOrigin-RevId: 454649199
2022-06-13 10:55:57 -07:00
edwinwu 67b318fa6f [BLE Refactor] Refactor GATTClient implementation.
PiperOrigin-RevId: 454290863
2022-06-10 20:20:40 -07:00
edwinwu c96875f310 Fixes A go/asan error (heap_use_after_free) found while running //third_party/nearby/connections/implementation:core_internal_test
PiperOrigin-RevId: 454288190
2022-06-10 20:00:03 -07:00
jfcarroll 88ee3ba338 This needs to be declared in order to build on windows (and since it's declared that way in the header)
PiperOrigin-RevId: 454077812
2022-06-09 21:09:31 -07:00
crisrael 89462d1d45 [NC] Fix nullptr crashes in BasePcpHandler
PiperOrigin-RevId: 453967262
2022-06-09 11:10:49 -07:00
edwinwu 9069451c08 [BLE Refactor] Add Base64 encoder to BleAdvertisementHeader
PiperOrigin-RevId: 453567012
2022-06-07 17:59:33 -07:00
hai007 7d3b6d7d82 Disable BWU from WLAN to Hotspot for Discoverer side
Windows doesn't support BWU from WIFI_LAN to WIFI_HOTSPOT. Because when the discoverer side try to switch from current AP to the Hotspot, it loss physical connection. When here's no physical connection, BWU protocol frame exchange won't be finished successfully, then BWU will fail eventually.
In the current code implementation, if Windows Nearby act as Advertiser, it will not do BWU from WLAN to Hotspot. This CL adds similar logic when Windows Nearby act as discoverer.

PiperOrigin-RevId: 453248717
2022-06-06 11:50:06 -07:00
hai007 37b0c31319 Add Wifi Hotspot AP and Client validation check
PiperOrigin-RevId: 451492039
2022-05-27 15:20:36 -07:00
hai007 519144eb24 [Analytics] Reorganize code structure for Analytics
- move AnalyticsRecorder to Connections specific folder
- log generic proto type in EventLogger

PiperOrigin-RevId: 451265563
2022-05-26 16:14:51 -07:00
hai007 500f67c85e Add Wifi Medium to query WIFI interface capability and information
PiperOrigin-RevId: 451233512
2022-05-26 13:40:14 -07:00
edwinwu 8e048f7be0 [BLE Refactor] Uses Uuid class for those used in Uuid string-form in /medium layer.
PiperOrigin-RevId: 450910238
2022-05-25 06:36:55 -07:00
aaronyujiaze cb8fef7875 Add fix to check the availability of BluetoothAdapter
This change makes sure BluetoothClassic and BLE medium can only be added to the CONNECTION_REQUEST frame if BluetoothAdapter is valid and enabled.

PiperOrigin-RevId: 450777716
2022-05-24 15:05:45 -07:00
edwinwu a1e84f0597 [BLE Refactor] Implements BleV2Socket and BleV2ServerSocket.
PiperOrigin-RevId: 450586535
2022-05-23 20:22:10 -07:00
johnsonlu 58d14a36bf Add comments of MediumMetadata
PiperOrigin-RevId: 449641256
2022-05-18 20:17:56 -07:00
edwinwu 01f439b9ad [BLE Refactor] Add Extended advertisement support.
PiperOrigin-RevId: 449619994
2022-05-18 17:45:04 -07:00
edwinwu 412f9e0752 [BLE Refactor] Connects BleV2 mediums to PCP handler.
PiperOrigin-RevId: 449196646
2022-05-17 05:42:05 -07:00
edwinwu eddf53ec29 [BLE Refactor] Removes fast advertisement uuid in StartAdvertising and StartScanning.
PiperOrigin-RevId: 448426759
2022-05-13 00:19:16 -07:00
edwinwu 080e964a4c [BLE Refactor] Implements GattClient for sender's device to fetch Gatt advertisement.
PiperOrigin-RevId: 448400837
2022-05-12 20:29:30 -07:00
hai007 73c0ce9c76 Remove deprecated usage of CreateDataChannel()
CreateDataChannelOrError() should be used instead.
If the code referencing the function allows it, error handling has been modified
to match the new function.

PiperOrigin-RevId: 448168890
2022-05-11 23:27:09 -07:00
edwinwu 12cef58420 [BLE Refactor] Refactor BlePeripheral class.
PiperOrigin-RevId: 447638179
2022-05-09 21:27:58 -07:00
hai007 487d272e24 Fix go/MSAN and coverage failure in:
https://critique.corp.google.com/cl/445437919

PiperOrigin-RevId: 447592532
2022-05-09 16:38:44 -07:00
hai007 cb2672de03 Fix go/tsan failure in:
https://critique.corp.google.com/cl/444788086

PiperOrigin-RevId: 447591426
2022-05-09 16:33:52 -07:00
edwinwu 771ce23fa3 [BLE Refactor] Implements advertisement tracking in Ble medium with DiscoveredPeripheralTracker class.
PiperOrigin-RevId: 447397658
2022-05-09 00:36:33 -07:00
hai007 8f4edf3c89 Delete use of implicit conversion from rtc::scoped_refptr<T> --> T*.
Intended to unblock landing of webrtc cl https://webrtc-review.googlesource.com/c/src/+/260325

PiperOrigin-RevId: 446091008
2022-05-02 19:39:40 -07:00
hai007 d09f53a40b Unit test for WIFI Hotspot in BWU layer
PiperOrigin-RevId: 445437919
2022-04-29 09:29:59 -07:00
hai007 8e80ee097a Unit test for WIFI Hotspot in Connection Medium layer
Fix 230126796: go/tsan error (data_race) found while running //third_party/nearby/internal/platform:public_test

PiperOrigin-RevId: 444788086
2022-04-27 01:21:23 -07:00
bourdakos da13735484 Update Package.swift and stub webrtc
PiperOrigin-RevId: 443722630
2022-04-22 11:57:15 -07:00
hai007 ec2d3ae1aa WIFI Hotspot implementation (4)
Part 4: BWU and client interface part

PiperOrigin-RevId: 443700883
2022-04-22 10:32:12 -07:00
jfcarroll 6fc5b64605 Flattening payload and listeners
PiperOrigin-RevId: 443168939
2022-04-20 12:55:23 -07:00
nohle 0c19f3f279 [NC] Track bandwidth upgrade mediums for each endpoint (fix)
Rename RevertInitiatedBwuMediumForEndpointIfNecessary to RevertBwuMediumForEndpoint because this method can be called by RESPONDERs of the bandwidth upgrade request. Also, make sure to remove the endpoint from the endpoint-to-medium map.

PiperOrigin-RevId: 442055611
2022-04-15 11:13:27 -07:00
nohle 98a5b9d0ee [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (4/4 unit tests)
Add unit tests for BaseBwuHandler and BwuManager (BWU initiation only). Add fake classes and helper methods needed for testing. Refine comments and logs.

PiperOrigin-RevId: 442021842
2022-04-15 08:33:21 -07:00
nohle e5fb3a8f11 [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (3/4)
* Fix bandwidth upgrade service ID usage. For instance, no longer use the inaccurate service ID from ClientProxy.
* Add more fine-grained upgraded endpoint tracking using both service IDs and endpoint IDs
* Only "revert" bandwidth-upgrade mediums--for example, stop accepting connections on a server socket--for a service when the last endpoint for that service is finished.

These changes are necessary to support multiple services (e.g., Nearby Share and Phone Hub) and multiple mediums (e.g., WebRTC and WLAN).

PiperOrigin-RevId: 442021257
2022-04-15 08:29:41 -07:00
nohle dee3e9cfb4 [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (2/4)
Consolidate BWU service ID bookkeeping into the BaseBwuHandler class. This eliminates duplicated code in per-medium BWU handlers and allows us to easily augment the bookkeeping with endpoint IDs in a subsequent CL.

Also, localize all service ID wrapping to the BaseBwuHandler class. A postfix is appended to the service ID during bandwidth upgrade, e.g., "NearbyShare_INITIATOR_BWU"; this is done to distinguish a medium's use for advertising/discovery vs. its use for device-to-device connections.

This CL should theoretically be a no-op, but per-medium BWU handlers were inconsistent in their implementations.

PiperOrigin-RevId: 442019603
2022-04-15 08:19:19 -07:00
nohle 463d391fcd [Nearby Connections][C++] Track bandwidth upgrade mediums for each endpoint (1/4)
This CL should be a no-op.

Provide better access to the service ID during bandwidth upgrade handling. Notably, 1) have the endpoint channel store its associated service ID, and 2) send the service ID on a connect/disconnect.

The service ID identifies the application, for example, "NearbySharing". In future CLs, we will use the service IDs to better handle bandwidth-upgrade bookkeeping when multiple services are running simultaneously. Specifically, we will better handle reverting a bandwidth-upgrade medium without interfering with other services.

PiperOrigin-RevId: 442019209
2022-04-15 08:15:53 -07:00
edwinwu d1b2437b0d [BLE Refactor] Implements BleExtraField in mediums::BleAdvertisement for Extended advertisement.
PiperOrigin-RevId: 441665698
2022-04-13 22:06:57 -07:00