Clean up flag safe_mode_timeout_config
Bug: 317406085 Test: atest FrameworksVcnTests && atest CtsVcnTestCases Flag: EXEMPT flag clean up Change-Id: I2f838156ffa9a2242747f4782e4d05833674e393
This commit is contained in:
parent
f0a2597ba3
commit
2860fd1bbf
5 changed files with 3 additions and 30 deletions
|
|
@ -17,13 +17,6 @@ flag {
|
|||
bug: "376339506"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "safe_mode_timeout_config"
|
||||
namespace: "vcn"
|
||||
description: "Feature flag for adjustable safe mode timeout"
|
||||
bug: "317406085"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "fix_config_garbage_collection"
|
||||
namespace: "vcn"
|
||||
|
|
|
|||
|
|
@ -74,10 +74,6 @@ public class VcnContext {
|
|||
return mFeatureFlags;
|
||||
}
|
||||
|
||||
public boolean isFlagSafeModeTimeoutConfigEnabled() {
|
||||
return mFeatureFlags.safeModeTimeoutConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that the caller is running on the VcnContext Thread.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1263,7 +1263,7 @@ public class VcnGatewayConnection extends StateMachine {
|
|||
final PersistableBundleWrapper carrierConfig = snapshot.getCarrierConfigForSubGrp(subGrp);
|
||||
int resultSeconds = defaultSeconds;
|
||||
|
||||
if (vcnContext.isFlagSafeModeTimeoutConfigEnabled() && carrierConfig != null) {
|
||||
if (carrierConfig != null) {
|
||||
resultSeconds =
|
||||
carrierConfig.getInt(
|
||||
VcnManager.VCN_SAFE_MODE_TIMEOUT_SECONDS_KEY, defaultSeconds);
|
||||
|
|
|
|||
|
|
@ -360,12 +360,10 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase {
|
|||
|
||||
private void verifyGetSafeModeTimeoutMs(
|
||||
boolean isInTestMode,
|
||||
boolean isConfigTimeoutSupported,
|
||||
PersistableBundleWrapper carrierConfig,
|
||||
long expectedTimeoutMs)
|
||||
throws Exception {
|
||||
doReturn(isInTestMode).when(mVcnContext).isInTestMode();
|
||||
doReturn(isConfigTimeoutSupported).when(mVcnContext).isFlagSafeModeTimeoutConfigEnabled();
|
||||
|
||||
final TelephonySubscriptionSnapshot snapshot = mock(TelephonySubscriptionSnapshot.class);
|
||||
doReturn(carrierConfig).when(snapshot).getCarrierConfigForSubGrp(TEST_SUB_GRP);
|
||||
|
|
@ -377,16 +375,7 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testGetSafeModeTimeoutMs_configTimeoutUnsupported() throws Exception {
|
||||
verifyGetSafeModeTimeoutMs(
|
||||
false /* isInTestMode */,
|
||||
false /* isConfigTimeoutSupported */,
|
||||
null /* carrierConfig */,
|
||||
TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSafeModeTimeoutMs_configTimeoutSupported() throws Exception {
|
||||
public void testGetSafeModeTimeoutMs() throws Exception {
|
||||
final int carrierConfigTimeoutSeconds = 20;
|
||||
final PersistableBundleWrapper carrierConfig = mock(PersistableBundleWrapper.class);
|
||||
doReturn(carrierConfigTimeoutSeconds)
|
||||
|
|
@ -395,17 +384,14 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase {
|
|||
|
||||
verifyGetSafeModeTimeoutMs(
|
||||
false /* isInTestMode */,
|
||||
true /* isConfigTimeoutSupported */,
|
||||
carrierConfig,
|
||||
TimeUnit.SECONDS.toMillis(carrierConfigTimeoutSeconds));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSafeModeTimeoutMs_configTimeoutSupported_carrierConfigNull()
|
||||
throws Exception {
|
||||
public void testGetSafeModeTimeoutMs_carrierConfigNull() throws Exception {
|
||||
verifyGetSafeModeTimeoutMs(
|
||||
false /* isInTestMode */,
|
||||
true /* isConfigTimeoutSupported */,
|
||||
null /* carrierConfig */,
|
||||
TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS));
|
||||
}
|
||||
|
|
@ -420,7 +406,6 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase {
|
|||
|
||||
verifyGetSafeModeTimeoutMs(
|
||||
true /* isInTestMode */,
|
||||
true /* isConfigTimeoutSupported */,
|
||||
carrierConfig,
|
||||
TimeUnit.SECONDS.toMillis(carrierConfigTimeoutSeconds));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,6 @@ public class VcnGatewayConnectionTestBase {
|
|||
doReturn(mTestLooper.getLooper()).when(mVcnContext).getLooper();
|
||||
doReturn(mVcnNetworkProvider).when(mVcnContext).getVcnNetworkProvider();
|
||||
doReturn(mFeatureFlags).when(mVcnContext).getFeatureFlags();
|
||||
doReturn(true).when(mVcnContext).isFlagSafeModeTimeoutConfigEnabled();
|
||||
|
||||
doReturn(mUnderlyingNetworkController)
|
||||
.when(mDeps)
|
||||
|
|
|
|||
Loading…
Reference in a new issue