Implement Auto-reconnect after disconnection [1]

PiperOrigin-RevId: 592344338
This commit is contained in:
hai007
2023-12-19 14:27:40 -08:00
committed by Copybara-Service
parent 850c3e2788
commit 16cb7f70b3
18 changed files with 1576 additions and 7 deletions
+8
View File
@@ -63,6 +63,12 @@ class FeatureFlags {
// on Windows when connecting to FP service id but the rfcomm is successful.
bool skip_service_discovery_before_connecting_to_rfcomm = false;
std::int32_t min_nc_version_supports_safe_to_disconnect = 1;
std::int32_t min_nc_version_supports_auto_reconnect = 3;
absl::Duration auto_reconnect_retry_delay_millis = absl::Milliseconds(5000);
absl::Duration auto_reconnect_timeout_millis = absl::Milliseconds(30000);
std::int32_t auto_reconnect_retry_attempts = 3;
absl::Duration auto_reconnect_skip_duplicated_endpoint_duration =
absl::Milliseconds(4000);
// Android code won't be able to launch "payload_received_ack" feature for
// in near future, so change "payload_received_ack" version from "2" to "5"
// after auto-reconnect and auto-resume.
@@ -73,6 +79,8 @@ class FeatureFlags {
absl::Milliseconds(30000);
absl::Duration safe_to_disconnect_remote_disc_delay_millis =
absl::Milliseconds(10000);
absl::Duration safe_to_disconnect_auto_resume_timeout_millis =
absl::Milliseconds(60000);
// If the receiver doesn't ack with payload_received_ack frame in 1s, the
// sender will timeout the waiting.
absl::Duration wait_payload_received_ack_millis = absl::Milliseconds(1000);
+1
View File
@@ -40,6 +40,7 @@ cc_library(
"timer.h",
],
visibility = [
"//connections/implementation:__subpackages__",
"//connections/implementation/analytics:__subpackages__",
"//fastpair:__subpackages__",
"//internal/account:__pkg__",