Speed up Android VPN stall recovery

This commit is contained in:
2026-05-15 01:09:07 +03:00
parent 495059b92e
commit d2746cac68
2 changed files with 8 additions and 5 deletions
@@ -77,9 +77,9 @@ public class RapVpnService extends VpnService {
private static final int RUNTIME_DETAIL_INTERVAL_MS = 250;
private static final int RUNTIME_STATUS_INTERVAL_MS = 500;
private static final int RUNTIME_WATCHDOG_INTERVAL_MS = 2000;
private static final int RUNTIME_WATCHDOG_STALE_SYNACK_MS = 15000;
private static final int RUNTIME_WATCHDOG_RECOVERY_COOLDOWN_MS = 60000;
private static final int RUNTIME_WATCHDOG_HARD_RESTART_COOLDOWN_MS = 180000;
private static final int RUNTIME_WATCHDOG_STALE_SYNACK_MS = 7000;
private static final int RUNTIME_WATCHDOG_RECOVERY_COOLDOWN_MS = 20000;
private static final int RUNTIME_WATCHDOG_HARD_RESTART_COOLDOWN_MS = 60000;
private static final int DIAGNOSTIC_WATCHDOG_INTERVAL_MS = 5000;
private static final int DIAGNOSTIC_STALE_RESTART_MS = 30000;
private static final int DIAGNOSTIC_RESTART_COOLDOWN_MS = 15000;
@@ -1581,6 +1581,9 @@ public class RapVpnService extends VpnService {
}
private boolean shouldHardRestartRuntime(long now) {
if (!PACKET_WEBSOCKET_DATAPLANE_ENABLED) {
return now - lastRuntimeWatchdogHardRestartAt >= RUNTIME_WATCHDOG_HARD_RESTART_COOLDOWN_MS;
}
if (runtimeWatchdogRecoveries.get() < 2) {
return false;
}