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

Commit 1a76725a authored by Yan Yan's avatar Yan Yan
Browse files

Clean up FLAG_HANDLE_SEQ_NUM_LEAP

Bug: 332598276
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT flag clean up
Change-Id: I3d0dd6251337d85a4c6f193d9a627e66024a79ab
parent 69ee324a
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -46,13 +46,3 @@ flag{
      purpose: PURPOSE_BUGFIX
    }
}
 No newline at end of file

flag{
    name: "handle_seq_num_leap"
    namespace: "vcn"
    description: "Do not report bad network when there is a suspected sequence number leap"
    bug: "332598276"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}
 No newline at end of file
+5 −8
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ public class IpSecPacketLossDetector extends NetworkMetricMonitor {
    @VisibleForTesting(visibility = Visibility.PRIVATE)
    static int getMaxSeqNumIncreasePerSecond(@Nullable PersistableBundleWrapper carrierConfig) {
        int maxSeqNumIncrease = MAX_SEQ_NUM_INCREASE_DEFAULT_DISABLED;
        if (Flags.handleSeqNumLeap() && carrierConfig != null) {
        if (carrierConfig != null) {
            maxSeqNumIncrease =
                    carrierConfig.getInt(
                            VcnManager.VCN_NETWORK_SELECTION_MAX_SEQ_NUM_INCREASE_PER_SECOND_KEY,
@@ -287,10 +287,8 @@ public class IpSecPacketLossDetector extends NetworkMetricMonitor {
        // with the new interval
        mPollIpSecStateIntervalMs = getPollIpSecStateIntervalMs(carrierConfig);

        if (Flags.handleSeqNumLeap()) {
        mPacketLossRatePercentThreshold = getPacketLossRatePercentThreshold(carrierConfig);
        mMaxSeqNumIncreasePerSecond = getMaxSeqNumIncreasePerSecond(carrierConfig);
        }

        if (canStart() != isStarted()) {
            if (canStart()) {
@@ -474,8 +472,7 @@ public class IpSecPacketLossDetector extends NetworkMetricMonitor {
            boolean isUnusualSeqNumLeap = false;

            // Handle sequence number leap
            if (Flags.handleSeqNumLeap()
                    && maxSeqNumIncreasePerSecond != MAX_SEQ_NUM_INCREASE_DEFAULT_DISABLED) {
            if (maxSeqNumIncreasePerSecond != MAX_SEQ_NUM_INCREASE_DEFAULT_DISABLED) {
                final long timeDiffMillis =
                        newState.getTimestampMillis() - oldState.getTimestampMillis();
                final long maxSeqNumIncrease = timeDiffMillis * maxSeqNumIncreasePerSecond / 1000;
@@ -506,7 +503,7 @@ public class IpSecPacketLossDetector extends NetworkMetricMonitor {
                            + " actualPktCntDiff: "
                            + actualPktCntDiff);

            if (Flags.handleSeqNumLeap() && expectedPktCntDiff < MIN_VALID_EXPECTED_RX_PACKET_NUM) {
            if (expectedPktCntDiff < MIN_VALID_EXPECTED_RX_PACKET_NUM) {
                // The sample size is too small to ensure a reliable detection result
                return PacketLossCalculationResult.invalid();
            }
+0 −1
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ public abstract class NetworkEvaluationTestBase {

        mSetFlagsRule.enableFlags(Flags.FLAG_VALIDATE_NETWORK_ON_IPSEC_LOSS);
        mSetFlagsRule.enableFlags(Flags.FLAG_EVALUATE_IPSEC_LOSS_ON_LP_NC_CHANGE);
        mSetFlagsRule.enableFlags(Flags.FLAG_HANDLE_SEQ_NUM_LEAP);

        when(mNetwork.getNetId()).thenReturn(-1);