Merge "Update set|getRetryIntervalsMs to Millis"
diff --git a/core/api/current.txt b/core/api/current.txt
index 1f2f6e8..d82cd72 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -25710,7 +25710,7 @@
method @NonNull public int[] getExposedCapabilities();
method @NonNull public String getGatewayConnectionName();
method @IntRange(from=android.net.vcn.VcnGatewayConnectionConfig.MIN_MTU_V6) public int getMaxMtu();
- method @NonNull public long[] getRetryIntervalsMs();
+ method @NonNull public long[] getRetryIntervalsMillis();
}
public static final class VcnGatewayConnectionConfig.Builder {
@@ -25719,7 +25719,7 @@
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig build();
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder removeExposedCapability(int);
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setMaxMtu(@IntRange(from=android.net.vcn.VcnGatewayConnectionConfig.MIN_MTU_V6) int);
- method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setRetryIntervalsMs(@NonNull long[]);
+ method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setRetryIntervalsMillis(@NonNull long[]);
}
public class VcnManager {
diff --git a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java b/core/java/android/net/vcn/VcnGatewayConnectionConfig.java
index 85ac5ef..be308d01 100644
--- a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java
+++ b/core/java/android/net/vcn/VcnGatewayConnectionConfig.java
@@ -136,7 +136,7 @@
* <p>To ensure the device is not constantly being woken up, this retry interval MUST be greater
* than this value.
*
- * @see {@link Builder#setRetryIntervalsMs()}
+ * @see {@link Builder#setRetryIntervalsMillis()}
*/
private static final long MINIMUM_REPEATING_RETRY_INTERVAL_MS = TimeUnit.MINUTES.toMillis(15);
@@ -337,10 +337,10 @@
/**
* Retrieves the configured retry intervals.
*
- * @see Builder#setRetryIntervalsMs(long[])
+ * @see Builder#setRetryIntervalsMillis(long[])
*/
@NonNull
- public long[] getRetryIntervalsMs() {
+ public long[] getRetryIntervalsMillis() {
return Arrays.copyOf(mRetryIntervalsMs, mRetryIntervalsMs.length);
}
@@ -550,7 +550,7 @@
* @see VcnManager for additional discussion on fail-safe mode
*/
@NonNull
- public Builder setRetryIntervalsMs(@NonNull long[] retryIntervalsMs) {
+ public Builder setRetryIntervalsMillis(@NonNull long[] retryIntervalsMs) {
validateRetryInterval(retryIntervalsMs);
mRetryIntervalsMs = retryIntervalsMs;
diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
index 08a1b7e..65b947c 100644
--- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
+++ b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
@@ -1851,7 +1851,7 @@
private long getNextRetryIntervalsMs() {
final int retryDelayIndex = mFailedAttempts - 1;
- final long[] retryIntervalsMs = mConnectionConfig.getRetryIntervalsMs();
+ final long[] retryIntervalsMs = mConnectionConfig.getRetryIntervalsMillis();
// Repeatedly use last item in retry timeout list.
if (retryDelayIndex >= retryIntervalsMs.length) {
diff --git a/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java b/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java
index 7cfd275..9410886 100644
--- a/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java
+++ b/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java
@@ -82,7 +82,7 @@
// Public for use in VcnGatewayConnectionTest
public static VcnGatewayConnectionConfig buildTestConfigWithExposedCaps(int... exposedCaps) {
final VcnGatewayConnectionConfig.Builder builder =
- newBuilder().setRetryIntervalsMs(RETRY_INTERVALS_MS).setMaxMtu(MAX_MTU);
+ newBuilder().setRetryIntervalsMillis(RETRY_INTERVALS_MS).setMaxMtu(MAX_MTU);
for (int caps : exposedCaps) {
builder.addExposedCapability(caps);
@@ -134,7 +134,7 @@
@Test
public void testBuilderRequiresNonNullRetryInterval() {
try {
- newBuilder().setRetryIntervalsMs(null);
+ newBuilder().setRetryIntervalsMillis(null);
fail("Expected exception due to invalid retryIntervalMs");
} catch (IllegalArgumentException e) {
}
@@ -143,7 +143,7 @@
@Test
public void testBuilderRequiresNonEmptyRetryInterval() {
try {
- newBuilder().setRetryIntervalsMs(new long[0]);
+ newBuilder().setRetryIntervalsMillis(new long[0]);
fail("Expected exception due to invalid retryIntervalMs");
} catch (IllegalArgumentException e) {
}
@@ -174,7 +174,7 @@
assertEquals(TUNNEL_CONNECTION_PARAMS, config.getTunnelConnectionParams());
- assertArrayEquals(RETRY_INTERVALS_MS, config.getRetryIntervalsMs());
+ assertArrayEquals(RETRY_INTERVALS_MS, config.getRetryIntervalsMillis());
assertEquals(MAX_MTU, config.getMaxMtu());
}
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionRetryTimeoutStateTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionRetryTimeoutStateTest.java
index 044bef5..a88f112 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionRetryTimeoutStateTest.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionRetryTimeoutStateTest.java
@@ -38,7 +38,7 @@
public void setUp() throws Exception {
super.setUp();
- mFirstRetryInterval = mConfig.getRetryIntervalsMs()[0];
+ mFirstRetryInterval = mConfig.getRetryIntervalsMillis()[0];
mGatewayConnection.setUnderlyingNetwork(TEST_UNDERLYING_NETWORK_RECORD_1);
mGatewayConnection.transitionTo(mGatewayConnection.mRetryTimeoutState);