diff options
4 files changed, 10 insertions, 24 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 2a16084f348e..42090f7f69f9 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -25708,7 +25708,7 @@ package android.net.vcn {      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[] getRetryInterval(); +    method @NonNull public long[] getRetryIntervalsMs();    }    public static final class VcnGatewayConnectionConfig.Builder { @@ -25717,7 +25717,7 @@ package android.net.vcn {      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 setRetryInterval(@NonNull long[]); +    method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder setRetryIntervalsMs(@NonNull long[]);    }    public class VcnManager { diff --git a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java b/core/java/android/net/vcn/VcnGatewayConnectionConfig.java index 75db3820f5e7..649e75e61268 100644 --- a/core/java/android/net/vcn/VcnGatewayConnectionConfig.java +++ b/core/java/android/net/vcn/VcnGatewayConnectionConfig.java @@ -134,7 +134,7 @@ public final class VcnGatewayConnectionConfig {       * <p>To ensure the device is not constantly being woken up, this retry interval MUST be greater       * than this value.       * -     * @see {@link Builder#setRetryInterval()} +     * @see {@link Builder#setRetryIntervalsMs()}       */      private static final long MINIMUM_REPEATING_RETRY_INTERVAL_MS = TimeUnit.MINUTES.toMillis(15); @@ -333,25 +333,11 @@ public final class VcnGatewayConnectionConfig {      /**       * Retrieves the configured retry intervals.       * -     * @see Builder#setRetryInterval(long[]) +     * @see Builder#setRetryIntervalsMs(long[])       */      @NonNull -    public long[] getRetryInterval() { -        return Arrays.copyOf(mRetryIntervalsMs, mRetryIntervalsMs.length); -    } - -    /** -     * Retrieves the configured retry intervals. -     * -     * <p>Left to prevent the need to make major changes while changes are actively in flight. -     * -     * @deprecated use getRetryInterval() instead -     * @hide -     */ -    @Deprecated -    @NonNull      public long[] getRetryIntervalsMs() { -        return getRetryInterval(); +        return Arrays.copyOf(mRetryIntervalsMs, mRetryIntervalsMs.length);      }      /** @@ -559,7 +545,7 @@ public final class VcnGatewayConnectionConfig {           * @see VcnManager for additional discussion on fail-safe mode           */          @NonNull -        public Builder setRetryInterval(@NonNull long[] retryIntervalsMs) { +        public Builder setRetryIntervalsMs(@NonNull long[] retryIntervalsMs) {              validateRetryInterval(retryIntervalsMs);              mRetryIntervalsMs = retryIntervalsMs; diff --git a/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java b/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java index 4ee4d611e9b0..db00670c9bcf 100644 --- a/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java +++ b/tests/vcn/java/android/net/vcn/VcnGatewayConnectionConfigTest.java @@ -81,7 +81,7 @@ public class VcnGatewayConnectionConfigTest {      // Public for use in VcnGatewayConnectionTest      public static VcnGatewayConnectionConfig buildTestConfigWithExposedCaps(int... exposedCaps) {          final VcnGatewayConnectionConfig.Builder builder = -                newBuilder().setRetryInterval(RETRY_INTERVALS_MS).setMaxMtu(MAX_MTU); +                newBuilder().setRetryIntervalsMs(RETRY_INTERVALS_MS).setMaxMtu(MAX_MTU);          for (int caps : exposedCaps) {              builder.addExposedCapability(caps); @@ -133,7 +133,7 @@ public class VcnGatewayConnectionConfigTest {      @Test      public void testBuilderRequiresNonNullRetryInterval() {          try { -            newBuilder().setRetryInterval(null); +            newBuilder().setRetryIntervalsMs(null);              fail("Expected exception due to invalid retryIntervalMs");          } catch (IllegalArgumentException e) {          } @@ -142,7 +142,7 @@ public class VcnGatewayConnectionConfigTest {      @Test      public void testBuilderRequiresNonEmptyRetryInterval() {          try { -            newBuilder().setRetryInterval(new long[0]); +            newBuilder().setRetryIntervalsMs(new long[0]);              fail("Expected exception due to invalid retryIntervalMs");          } catch (IllegalArgumentException e) {          } diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionRetryTimeoutStateTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionRetryTimeoutStateTest.java index 6dbf7d552bb6..044bef5b002f 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 class VcnGatewayConnectionRetryTimeoutStateTest extends VcnGatewayConnect      public void setUp() throws Exception {          super.setUp(); -        mFirstRetryInterval = mConfig.getRetryInterval()[0]; +        mFirstRetryInterval = mConfig.getRetryIntervalsMs()[0];          mGatewayConnection.setUnderlyingNetwork(TEST_UNDERLYING_NETWORK_RECORD_1);          mGatewayConnection.transitionTo(mGatewayConnection.mRetryTimeoutState);  |