Merge changes from topics "recoveryTimeUnit", "vpnRecovery" am: 9273181fca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2648345 Change-Id: Ie0b5d315e7a3c6fcda684a5195062abe55d7d6e2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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
|
* <p>If retries have exceeded the length of this array, the last entry in the array will be
|
||||||
* used as a repeating interval.
|
* used as a repeating interval.
|
||||||
*/
|
*/
|
||||||
// TODO: use ms instead to speed up the test.
|
private static final long[] DATA_STALL_RECOVERY_DELAYS_MS =
|
||||||
private static final long[] DATA_STALL_RECOVERY_DELAYS_SEC =
|
{1000L, 5000L, 30000L, 60000L, 120000L, 240000L, 480000L, 960000L};
|
||||||
{1L, 5L, 30L, 60L, 120L, 240L, 480L, 960L};
|
|
||||||
/**
|
/**
|
||||||
* Maximum attempts to perform MOBIKE when the network is bad.
|
* 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
|
* Get the length of time to wait before perform data stall recovery when the validation
|
||||||
* result is bad.
|
* result is bad.
|
||||||
*/
|
*/
|
||||||
public long getValidationFailRecoverySeconds(int count) {
|
public long getValidationFailRecoveryMs(int count) {
|
||||||
if (count >= DATA_STALL_RECOVERY_DELAYS_SEC.length) {
|
if (count >= DATA_STALL_RECOVERY_DELAYS_MS.length) {
|
||||||
return DATA_STALL_RECOVERY_DELAYS_SEC[DATA_STALL_RECOVERY_DELAYS_SEC.length - 1];
|
return DATA_STALL_RECOVERY_DELAYS_MS[DATA_STALL_RECOVERY_DELAYS_MS.length - 1];
|
||||||
} else {
|
} 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.
|
// Trigger MOBIKE to recover first.
|
||||||
mExecutor.schedule(() -> {
|
mExecutor.schedule(() -> {
|
||||||
maybeMigrateIkeSessionAndUpdateVpnTransportInfo(mActiveNetwork);
|
maybeMigrateIkeSessionAndUpdateVpnTransportInfo(mActiveNetwork);
|
||||||
}, mDeps.getValidationFailRecoverySeconds(mValidationFailRetryCount++),
|
}, mDeps.getValidationFailRecoveryMs(mValidationFailRetryCount++),
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.MILLISECONDS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3910,8 +3909,8 @@ public class Vpn {
|
|||||||
// thread.
|
// thread.
|
||||||
mScheduledHandleDataStallFuture = null;
|
mScheduledHandleDataStallFuture = null;
|
||||||
// TODO: compute the delay based on the last recovery timestamp
|
// TODO: compute the delay based on the last recovery timestamp
|
||||||
}, mDeps.getValidationFailRecoverySeconds(mValidationFailRetryCount++),
|
}, mDeps.getValidationFailRecoveryMs(mValidationFailRetryCount++),
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user