Merge "Hide required underlying caps APIs"
This commit is contained in:
@@ -25690,17 +25690,14 @@ package android.net.vcn {
|
|||||||
public final class VcnGatewayConnectionConfig {
|
public final class VcnGatewayConnectionConfig {
|
||||||
method @NonNull public int[] getExposedCapabilities();
|
method @NonNull public int[] getExposedCapabilities();
|
||||||
method @IntRange(from=android.net.vcn.VcnGatewayConnectionConfig.MIN_MTU_V6) public int getMaxMtu();
|
method @IntRange(from=android.net.vcn.VcnGatewayConnectionConfig.MIN_MTU_V6) public int getMaxMtu();
|
||||||
method @NonNull public int[] getRequiredUnderlyingCapabilities();
|
|
||||||
method @NonNull public long[] getRetryInterval();
|
method @NonNull public long[] getRetryInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class VcnGatewayConnectionConfig.Builder {
|
public static final class VcnGatewayConnectionConfig.Builder {
|
||||||
ctor public VcnGatewayConnectionConfig.Builder(@NonNull android.net.vcn.VcnControlPlaneConfig);
|
ctor public VcnGatewayConnectionConfig.Builder(@NonNull android.net.vcn.VcnControlPlaneConfig);
|
||||||
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addExposedCapability(int);
|
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addExposedCapability(int);
|
||||||
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder addRequiredUnderlyingCapability(int);
|
|
||||||
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig build();
|
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 removeExposedCapability(int);
|
||||||
method @NonNull public android.net.vcn.VcnGatewayConnectionConfig.Builder removeRequiredUnderlyingCapability(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 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 setRetryInterval(@NonNull long[]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,13 +52,12 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* Network}s.
|
* Network}s.
|
||||||
*
|
*
|
||||||
* <p>A VCN connection based on this configuration will be brought up dynamically based on device
|
* <p>A VCN connection based on this configuration will be brought up dynamically based on device
|
||||||
* settings, and filed NetworkRequests. Underlying networks will be selected based on the services
|
* settings, and filed NetworkRequests. Underlying Networks must provide INTERNET connectivity, and
|
||||||
* required by this configuration (as represented by network capabilities), and must be part of the
|
* must be part of the subscription group under which this configuration is registered (see {@link
|
||||||
* subscription group under which this configuration is registered (see {@link
|
|
||||||
* VcnManager#setVcnConfig}).
|
* VcnManager#setVcnConfig}).
|
||||||
*
|
*
|
||||||
* <p>As an abstraction of a cellular network, services that can be provided by a VCN network, or
|
* <p>As an abstraction of a cellular network, services that can be provided by a VCN network are
|
||||||
* required for underlying networks are limited to services provided by cellular networks:
|
* limited to services provided by cellular networks:
|
||||||
*
|
*
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link NetworkCapabilities#NET_CAPABILITY_MMS}
|
* <li>{@link NetworkCapabilities#NET_CAPABILITY_MMS}
|
||||||
@@ -214,13 +213,6 @@ public final class VcnGatewayConnectionConfig {
|
|||||||
checkValidCapability(cap);
|
checkValidCapability(cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
Preconditions.checkArgument(
|
|
||||||
mUnderlyingCapabilities != null && !mUnderlyingCapabilities.isEmpty(),
|
|
||||||
"underlyingCapabilities was null or empty");
|
|
||||||
for (Integer cap : getAllUnderlyingCapabilities()) {
|
|
||||||
checkValidCapability(cap);
|
|
||||||
}
|
|
||||||
|
|
||||||
Objects.requireNonNull(mRetryIntervalsMs, "retryIntervalsMs was null");
|
Objects.requireNonNull(mRetryIntervalsMs, "retryIntervalsMs was null");
|
||||||
validateRetryInterval(mRetryIntervalsMs);
|
validateRetryInterval(mRetryIntervalsMs);
|
||||||
|
|
||||||
@@ -295,7 +287,9 @@ public final class VcnGatewayConnectionConfig {
|
|||||||
*
|
*
|
||||||
* @see Builder#addRequiredUnderlyingCapability(int)
|
* @see Builder#addRequiredUnderlyingCapability(int)
|
||||||
* @see Builder#removeRequiredUnderlyingCapability(int)
|
* @see Builder#removeRequiredUnderlyingCapability(int)
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
// TODO(b/182219992): Remove, and add when per-transport capabilities are supported
|
||||||
@NonNull
|
@NonNull
|
||||||
public int[] getRequiredUnderlyingCapabilities() {
|
public int[] getRequiredUnderlyingCapabilities() {
|
||||||
// Sorted set guarantees ordering
|
// Sorted set guarantees ordering
|
||||||
@@ -470,7 +464,9 @@ public final class VcnGatewayConnectionConfig {
|
|||||||
* @return this {@link Builder} instance, for chaining
|
* @return this {@link Builder} instance, for chaining
|
||||||
* @see VcnGatewayConnectionConfig for a list of capabilities may be required of underlying
|
* @see VcnGatewayConnectionConfig for a list of capabilities may be required of underlying
|
||||||
* networks
|
* networks
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
// TODO(b/182219992): Remove, and add when per-transport capabilities are supported
|
||||||
@NonNull
|
@NonNull
|
||||||
public Builder addRequiredUnderlyingCapability(
|
public Builder addRequiredUnderlyingCapability(
|
||||||
@VcnSupportedCapability int underlyingCapability) {
|
@VcnSupportedCapability int underlyingCapability) {
|
||||||
@@ -492,7 +488,9 @@ public final class VcnGatewayConnectionConfig {
|
|||||||
* @return this {@link Builder} instance, for chaining
|
* @return this {@link Builder} instance, for chaining
|
||||||
* @see VcnGatewayConnectionConfig for a list of capabilities may be required of underlying
|
* @see VcnGatewayConnectionConfig for a list of capabilities may be required of underlying
|
||||||
* networks
|
* networks
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
// TODO(b/182219992): Remove, and add when per-transport capabilities are supported
|
||||||
@NonNull
|
@NonNull
|
||||||
@SuppressLint("BuilderSetStyle") // For consistency with NetCaps.Builder add/removeCap
|
@SuppressLint("BuilderSetStyle") // For consistency with NetCaps.Builder add/removeCap
|
||||||
public Builder removeRequiredUnderlyingCapability(
|
public Builder removeRequiredUnderlyingCapability(
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public class VcnManager {
|
|||||||
* @param networkCapabilities an array of NetworkCapabilities.NET_CAPABILITY_* capabilities
|
* @param networkCapabilities an array of NetworkCapabilities.NET_CAPABILITY_* capabilities
|
||||||
* for the Gateway Connection that encountered the error, for identification purposes.
|
* for the Gateway Connection that encountered the error, for identification purposes.
|
||||||
* These will be a sorted list with no duplicates and will match {@link
|
* These will be a sorted list with no duplicates and will match {@link
|
||||||
* VcnGatewayConnectionConfig#getRequiredUnderlyingCapabilities()} for one of the {@link
|
* VcnGatewayConnectionConfig#getExposedCapabilities()} for one of the {@link
|
||||||
* VcnGatewayConnectionConfig}s set in the {@link VcnConfig} for this subscription
|
* VcnGatewayConnectionConfig}s set in the {@link VcnConfig} for this subscription
|
||||||
* group.
|
* group.
|
||||||
* @param errorCode the code to indicate the error that occurred
|
* @param errorCode the code to indicate the error that occurred
|
||||||
|
|||||||
@@ -108,16 +108,6 @@ public class VcnGatewayConnectionConfigTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testBuilderRequiresNonEmptyUnderlyingCaps() {
|
|
||||||
try {
|
|
||||||
newBuilder().addExposedCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET).build();
|
|
||||||
|
|
||||||
fail("Expected exception due to invalid required underlying capabilities");
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBuilderRequiresNonNullRetryInterval() {
|
public void testBuilderRequiresNonNullRetryInterval() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user