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

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

Merge "VCN: Adopt the API name changes of IpSecTransformState" into main

parents bcf722f0 42d6c4ea
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -252,7 +252,7 @@ public class IpSecPacketLossDetector extends NetworkMetricMonitor {
            }
            }


            getInboundTransformInternal()
            getInboundTransformInternal()
                    .getIpSecTransformState(
                    .requestIpSecTransformState(
                            new HandlerExecutor(mHandler), new IpSecTransformStateReceiver());
                            new HandlerExecutor(mHandler), new IpSecTransformStateReceiver());


            // Schedule for next poll
            // Schedule for next poll
@@ -302,7 +302,8 @@ public class IpSecPacketLossDetector extends NetworkMetricMonitor {
                "packetLossRate: "
                "packetLossRate: "
                        + packetLossRate
                        + packetLossRate
                        + "% in the past "
                        + "% in the past "
                        + (state.getTimestamp() - mLastIpSecTransformState.getTimestamp())
                        + (state.getTimestampMillis()
                                - mLastIpSecTransformState.getTimestampMillis())
                        + "ms";
                        + "ms";


        mLastIpSecTransformState = state;
        mLastIpSecTransformState = state;
+2 −2
Original line number Original line Diff line number Diff line
@@ -138,10 +138,10 @@ public abstract class NetworkMetricMonitor implements AutoCloseable {
        }
        }


        /** Poll an IpSecTransformState */
        /** Poll an IpSecTransformState */
        public void getIpSecTransformState(
        public void requestIpSecTransformState(
                @NonNull Executor executor,
                @NonNull Executor executor,
                @NonNull OutcomeReceiver<IpSecTransformState, RuntimeException> callback) {
                @NonNull OutcomeReceiver<IpSecTransformState, RuntimeException> callback) {
            ipSecTransform.getIpSecTransformState(executor, callback);
            ipSecTransform.requestIpSecTransformState(executor, callback);
        }
        }


        /** Close this instance and release the underlying resources */
        /** Close this instance and release the underlying resources */
+2 −2
Original line number Original line Diff line number Diff line
@@ -144,7 +144,7 @@ public class IpSecPacketLossDetectorTest extends NetworkEvaluationTestBase {
        mTestLooper.dispatchAll();
        mTestLooper.dispatchAll();


        verify(mIpSecTransform)
        verify(mIpSecTransform)
                .getIpSecTransformState(any(), mTransformStateReceiverCaptor.capture());
                .requestIpSecTransformState(any(), mTransformStateReceiverCaptor.capture());
        return mTransformStateReceiverCaptor.getValue();
        return mTransformStateReceiverCaptor.getValue();
    }
    }


@@ -210,7 +210,7 @@ public class IpSecPacketLossDetectorTest extends NetworkEvaluationTestBase {
        assertNull(mIpSecPacketLossDetector.getLastTransformState());
        assertNull(mIpSecPacketLossDetector.getLastTransformState());
        mTestLooper.moveTimeForward(POLL_IPSEC_STATE_INTERVAL_MS);
        mTestLooper.moveTimeForward(POLL_IPSEC_STATE_INTERVAL_MS);
        mTestLooper.dispatchAll();
        mTestLooper.dispatchAll();
        verify(newTransform).getIpSecTransformState(any(), any());
        verify(newTransform).requestIpSecTransformState(any(), any());
    }
    }


    @Test
    @Test