Remove underlying network caps

This change removes unused fields in the persistable bundle and
VcnGatewayConnectionConfig classes to ensure future flexibility.

Bug: 182219992
Test: atest FrameworksVcnTests
Change-Id: Ic2fec8a87fd19a1780333c61759c4092598d349e
Merged-In: Ic2fec8a87fd19a1780333c61759c4092598d349e
(cherry picked from commit 1f06b95c62)
This commit is contained in:
Benedict Wong
2021-05-19 22:44:47 +00:00
parent f294d0ba5f
commit 4ab47decd6
6 changed files with 2 additions and 119 deletions

View File

@@ -92,10 +92,6 @@ public class VcnGatewayConnectionConfigTest {
builder.addExposedCapability(caps);
}
for (int caps : UNDERLYING_CAPS) {
builder.addRequiredUnderlyingCapability(caps);
}
return builder.build();
}
@@ -141,9 +137,7 @@ public class VcnGatewayConnectionConfigTest {
@Test
public void testBuilderRequiresNonEmptyExposedCaps() {
try {
newBuilder()
.addRequiredUnderlyingCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build();
newBuilder().build();
fail("Expected exception due to invalid exposed capabilities");
} catch (IllegalArgumentException e) {
@@ -187,10 +181,6 @@ public class VcnGatewayConnectionConfigTest {
Arrays.sort(exposedCaps);
assertArrayEquals(EXPOSED_CAPS, exposedCaps);
int[] underlyingCaps = config.getRequiredUnderlyingCapabilities();
Arrays.sort(underlyingCaps);
assertArrayEquals(UNDERLYING_CAPS, underlyingCaps);
assertEquals(TUNNEL_CONNECTION_PARAMS, config.getTunnelConnectionParams());
assertArrayEquals(RETRY_INTERVALS_MS, config.getRetryIntervalsMillis());

View File

@@ -61,7 +61,6 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.UUID;
@@ -146,7 +145,6 @@ public class UnderlyingNetworkTrackerTest {
mVcnContext,
SUB_GROUP,
mSubscriptionSnapshot,
Collections.singleton(NetworkCapabilities.NET_CAPABILITY_INTERNET),
mNetworkTrackerCb);
}
@@ -187,7 +185,6 @@ public class UnderlyingNetworkTrackerTest {
vcnContext,
SUB_GROUP,
mSubscriptionSnapshot,
Collections.singleton(NetworkCapabilities.NET_CAPABILITY_INTERNET),
mNetworkTrackerCb);
verify(cm)

View File

@@ -177,7 +177,7 @@ public class VcnGatewayConnectionTestBase {
doReturn(mUnderlyingNetworkTracker)
.when(mDeps)
.newUnderlyingNetworkTracker(any(), any(), any(), any(), any());
.newUnderlyingNetworkTracker(any(), any(), any(), any());
doReturn(mWakeLock)
.when(mDeps)
.newWakeLock(eq(mContext), eq(PowerManager.PARTIAL_WAKE_LOCK), any());