Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc47505d authored by Benedict Wong's avatar Benedict Wong Committed by Automerger Merge Worker
Browse files

Merge "Rename get/setRetryInterval to get/setRetryIntervalsMs" am: 9ef01fca...

Merge "Rename get/setRetryInterval to get/setRetryIntervalsMs" am: 9ef01fca am: a746f701 am: 42595279

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682061

Change-Id: If957c0783fd0e7f4a6340eed8cd6e19b466048a3
parents 08b9d388 42595279
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27093,7 +27093,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 {
@@ -27102,7 +27102,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 {
+4 −18
Original line number Diff line number Diff line
@@ -139,7 +139,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);

@@ -338,25 +338,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);
    }

    /**
@@ -564,7 +550,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;
+3 −3
Original line number Diff line number Diff line
@@ -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) {
        }
+1 −1
Original line number Diff line number Diff line
@@ -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);