[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
This commit is contained in:
nohle
2022-04-15 08:29:41 -07:00
committed by Copybara-Service
parent dee3e9cfb4
commit e5fb3a8f11
8 changed files with 335 additions and 210 deletions
+4
View File
@@ -42,6 +42,10 @@ class FeatureFlags {
absl::Duration bwu_retry_exp_backoff_maximum_delay = absl::Seconds(300);
// Support sending file and stream payloads starting from a non-zero offset.
bool enable_send_payload_offset = true;
// Provide better bookkeeping for bandwidth upgrade initiation. This is
// necessary to properly support multiple BWU mediums, multiple service, and
// multiple endpionts.
bool support_multiple_bwu_mediums = true;
};
static const FeatureFlags& GetInstance() {