webrtc/sdk
Jonas Oreland faf376cd7d Implement IsAdapterAvailable in AndroidNetworkMonitor
This cl/ fixes a race condition with the recent additions
to NetworkMonitorAutoDetect (getAllNetworksFromCache).

The getAllNetworksFromCache-feature uses the by the Android team preferred way of
enumerating networks, i.e to register network listeners.

This however introduces a unpleasant race condition like this:
1) network.cc discover rmnet0
2) BasicPortAllocator tries to create UDP port on rmnet0
- This fails as BindSocketToNetwork requires a android handle.
3) NetworkMonitorAutoDetect gets callback with rmnet0
4) BasicPortAllocator tries to create TCP port on rmnet0
- This succeeds.
5) Since rmnet0 has one working port, there will not be
any new ports created on that network

=> We end up with a TCP only connection :(

---

By impl. IsAdapterAvailable, we make sure that the network
will not be used by BasicPortAllocator (or anyone else!)
until we support binding to it.

The IsAdapterAvailable was implemented for IOS,
and has test coverage using FakeNetworkManager.

This cl/ is default enabled with the kill-switch
WebRTC-AndroidNetworkMonitor-IsAdapterAvailable.

Bug: webrtc:13741
Change-Id: I7c2cb7789660fd2e082c214d00e50c894666b07c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257400
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36406}
2022-04-01 13:16:26 +00:00
..
android Implement IsAdapterAvailable in AndroidNetworkMonitor 2022-04-01 13:16:26 +00:00
objc Added new apple devices. 2022-03-29 15:40:35 +00:00
BUILD.gn WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf 2022-03-29 10:14:00 +00:00
media_constraints.cc Remove unused audio options and corresponding media constraints 2022-02-14 10:50:20 +00:00
media_constraints.h Remove unused audio options and corresponding media constraints 2022-02-14 10:50:20 +00:00
media_constraints_unittest.cc Remove enable_dtls_srtp option 2021-10-26 10:35:41 +00:00
OWNERS Remove wildcard ownership for build files. 2020-02-19 14:05:46 +00:00