Loading src/android/net/ip/IpClient.java +1 −1 Original line number Diff line number Diff line Loading @@ -1793,7 +1793,7 @@ public class IpClient extends StateMachine { case EVENT_NETLINK_LINKPROPERTIES_CHANGED: handleLinkPropertiesUpdate(NO_CALLBACKS); if (readyToProceed()) { transitionTo(mRunningState); transitionTo(isUsingPreconnection() ? mPreconnectingState : mRunningState); } break; Loading tests/integration/src/android/net/ip/IpClientIntegrationTest.java +22 −2 Original line number Diff line number Diff line Loading @@ -1661,8 +1661,7 @@ public class IpClientIntegrationTest { HandlerUtilsKt.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS); } @Test public void testIpClientClearingIpAddressState() throws Exception { private void doIPv4OnlyProvisioningAndExitWithLeftAddress() throws Exception { final long currentTime = System.currentTimeMillis(); performDhcpHandshake(true /* isSuccessLease */, TEST_LEASE_DURATION_S, true /* isDhcpLeaseCacheEnabled */, false /* shouldReplyRapidCommitAck */, Loading @@ -1687,6 +1686,11 @@ public class IpClientIntegrationTest { // TODO: once IpClient gets IP addresses directly from netlink instead of from netd, it // may be sufficient to call waitForIdle to see if IpClient has seen the address. addIpAddressAndWaitForIt(mIfaceName); } @Test public void testIpClientClearingIpAddressState() throws Exception { doIPv4OnlyProvisioningAndExitWithLeftAddress(); ProvisioningConfiguration config = new ProvisioningConfiguration.Builder() .withoutIpReachabilityMonitor() Loading @@ -1705,6 +1709,22 @@ public class IpClientIntegrationTest { assertEquals("0.0.0.0", cfg.ipv4Addr); } @Test public void testIpClientClearingIpAddressState_enablePreconnection() throws Exception { doIPv4OnlyProvisioningAndExitWithLeftAddress(); // Enter ClearingIpAddressesState to clear the remaining IPv4 addresses and transition to // PreconnectionState instead of RunningState. startIpClientProvisioning(false /* isDhcpLeaseCacheEnabled */, false /* shouldReplyRapidCommitAck */, true /* isDhcpPreConnectionEnabled */, false /* isDhcpIpConflictDetectEnabled */); assertDiscoverPacketOnPreconnectionStart(); // Force to enter RunningState. mIpc.notifyPreconnectionComplete(false /* abort */); HandlerUtilsKt.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS); } @Test public void testDhcpClientPreconnection_success() throws Exception { doIpClientProvisioningWithPreconnectionTest(true /* shouldReplyRapidCommitAck */, Loading Loading
src/android/net/ip/IpClient.java +1 −1 Original line number Diff line number Diff line Loading @@ -1793,7 +1793,7 @@ public class IpClient extends StateMachine { case EVENT_NETLINK_LINKPROPERTIES_CHANGED: handleLinkPropertiesUpdate(NO_CALLBACKS); if (readyToProceed()) { transitionTo(mRunningState); transitionTo(isUsingPreconnection() ? mPreconnectingState : mRunningState); } break; Loading
tests/integration/src/android/net/ip/IpClientIntegrationTest.java +22 −2 Original line number Diff line number Diff line Loading @@ -1661,8 +1661,7 @@ public class IpClientIntegrationTest { HandlerUtilsKt.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS); } @Test public void testIpClientClearingIpAddressState() throws Exception { private void doIPv4OnlyProvisioningAndExitWithLeftAddress() throws Exception { final long currentTime = System.currentTimeMillis(); performDhcpHandshake(true /* isSuccessLease */, TEST_LEASE_DURATION_S, true /* isDhcpLeaseCacheEnabled */, false /* shouldReplyRapidCommitAck */, Loading @@ -1687,6 +1686,11 @@ public class IpClientIntegrationTest { // TODO: once IpClient gets IP addresses directly from netlink instead of from netd, it // may be sufficient to call waitForIdle to see if IpClient has seen the address. addIpAddressAndWaitForIt(mIfaceName); } @Test public void testIpClientClearingIpAddressState() throws Exception { doIPv4OnlyProvisioningAndExitWithLeftAddress(); ProvisioningConfiguration config = new ProvisioningConfiguration.Builder() .withoutIpReachabilityMonitor() Loading @@ -1705,6 +1709,22 @@ public class IpClientIntegrationTest { assertEquals("0.0.0.0", cfg.ipv4Addr); } @Test public void testIpClientClearingIpAddressState_enablePreconnection() throws Exception { doIPv4OnlyProvisioningAndExitWithLeftAddress(); // Enter ClearingIpAddressesState to clear the remaining IPv4 addresses and transition to // PreconnectionState instead of RunningState. startIpClientProvisioning(false /* isDhcpLeaseCacheEnabled */, false /* shouldReplyRapidCommitAck */, true /* isDhcpPreConnectionEnabled */, false /* isDhcpIpConflictDetectEnabled */); assertDiscoverPacketOnPreconnectionStart(); // Force to enter RunningState. mIpc.notifyPreconnectionComplete(false /* abort */); HandlerUtilsKt.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS); } @Test public void testDhcpClientPreconnection_success() throws Exception { doIpClientProvisioningWithPreconnectionTest(true /* shouldReplyRapidCommitAck */, Loading