diff options
| author | 2023-07-04 10:50:22 +0000 | |
|---|---|---|
| committer | 2023-07-04 10:50:22 +0000 | |
| commit | 8138dc25e55d72c0f9e3cf1f9da94d725f8359b5 (patch) | |
| tree | 6619f3307a686d767ad3c2d67257cce732e1e221 | |
| parent | afbda8694b16eabb101dc77bac6f55e017075a4a (diff) | |
| parent | 57fd8ddf79e87a72dcb8f3851334bfebebf5e650 (diff) | |
Merge changes from topics "recoveryTimeUnit", "vpnRecovery" am: 9273181fca am: 727e0d6f8b am: 57fd8ddf79
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2648345
Change-Id: Ia80832d74fdc98d6b994b72ee76a9872ae8a5825
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/connectivity/Vpn.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index 0786411695b0..79c50804ac5f 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -288,9 +288,8 @@ public class Vpn { * <p>If retries have exceeded the length of this array, the last entry in the array will be * used as a repeating interval. */ - // TODO: use ms instead to speed up the test. - private static final long[] DATA_STALL_RECOVERY_DELAYS_SEC = - {1L, 5L, 30L, 60L, 120L, 240L, 480L, 960L}; + private static final long[] DATA_STALL_RECOVERY_DELAYS_MS = + {1000L, 5000L, 30000L, 60000L, 120000L, 240000L, 480000L, 960000L}; /** * Maximum attempts to perform MOBIKE when the network is bad. */ @@ -693,11 +692,11 @@ public class Vpn { * Get the length of time to wait before perform data stall recovery when the validation * result is bad. */ - public long getValidationFailRecoverySeconds(int count) { - if (count >= DATA_STALL_RECOVERY_DELAYS_SEC.length) { - return DATA_STALL_RECOVERY_DELAYS_SEC[DATA_STALL_RECOVERY_DELAYS_SEC.length - 1]; + public long getValidationFailRecoveryMs(int count) { + if (count >= DATA_STALL_RECOVERY_DELAYS_MS.length) { + return DATA_STALL_RECOVERY_DELAYS_MS[DATA_STALL_RECOVERY_DELAYS_MS.length - 1]; } else { - return DATA_STALL_RECOVERY_DELAYS_SEC[count]; + return DATA_STALL_RECOVERY_DELAYS_MS[count]; } } @@ -3892,8 +3891,8 @@ public class Vpn { // Trigger MOBIKE to recover first. mExecutor.schedule(() -> { maybeMigrateIkeSessionAndUpdateVpnTransportInfo(mActiveNetwork); - }, mDeps.getValidationFailRecoverySeconds(mValidationFailRetryCount++), - TimeUnit.SECONDS); + }, mDeps.getValidationFailRecoveryMs(mValidationFailRetryCount++), + TimeUnit.MILLISECONDS); return; } @@ -3910,8 +3909,8 @@ public class Vpn { // thread. mScheduledHandleDataStallFuture = null; // TODO: compute the delay based on the last recovery timestamp - }, mDeps.getValidationFailRecoverySeconds(mValidationFailRetryCount++), - TimeUnit.SECONDS); + }, mDeps.getValidationFailRecoveryMs(mValidationFailRetryCount++), + TimeUnit.MILLISECONDS); } } |