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

Commit de21a095 authored by Yan Yan's avatar Yan Yan Committed by Gerrit Code Review
Browse files

Merge "Clean up flag safe_mode_timeout_config" into main

parents 37c4b107 ce7ee1f7
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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"
+0 −4
Original line number Diff line number Diff line
@@ -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.
     *
+1 −1
Original line number Diff line number Diff line
@@ -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);
+2 −17
Original line number Diff line number Diff line
@@ -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));
    }
+0 −1
Original line number Diff line number Diff line
@@ -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)