From 1f20cb6617d30e0f6a788a29ba1827881c09b3b8 Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Tue, 28 Apr 2020 04:15:07 +0000 Subject: Refactor DHCP server with StateMachine. To support DHCPDECLINE message and request a new prefix from IpServer, a WaitState is required to wait until IpServer allocates a different prefix and completes configuring this prefix/route. Then server could resume from pausing DHCP packets listening. From this point, StateMachine is easier to add a WaitState for implementation. Refactor DHCP server by replacing ThreadHandler with StateMachine first. Bug: 130741856 Test: atest NetworkStackTests NetworkStackNextTests Test: manual test: connect wifi, turn on hotspot, downstream device attaches to hotspot successfully, then turn off hotspot, repeat multiple times. Merged-In: I6c09d9c371e9c4e71d8ba26adaed640e3b97437b Change-Id: I6c09d9c371e9c4e71d8ba26adaed640e3b97437b --- src/com/android/server/NetworkStackService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/android/server/NetworkStackService.java') diff --git a/src/com/android/server/NetworkStackService.java b/src/com/android/server/NetworkStackService.java index 5de5837..8710e67 100644 --- a/src/com/android/server/NetworkStackService.java +++ b/src/com/android/server/NetworkStackService.java @@ -356,7 +356,7 @@ public class NetworkStackService extends Service { cb.onDhcpServerCreated(STATUS_UNKNOWN_ERROR, null); return; } - cb.onDhcpServerCreated(STATUS_SUCCESS, server); + cb.onDhcpServerCreated(STATUS_SUCCESS, server.makeConnector()); } @Override -- cgit v1.2.3