diff options
author | Erik Kline <ek@google.com> | 2018-05-09 14:45:21 +0900 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2018-05-09 14:27:37 -0700 |
commit | 4dee5fb135b11e155c81fc6defe6c57a583c5d81 (patch) | |
tree | 244efdda84e583307121d012f5c72fd03693fa34 /service | |
parent | 2c88f670aad308c91801c7bfeabbce8d78a506fe (diff) |
Also await IpClient's shutdown
It may be best to await shutdown of IpClient, especially in cases
where cleanup code would otherwise race with IP address assignment
and other bringup code.
Test: as follows
- built
- flashed
- booted
- frameworks/opt/net/wifi/tests/wifitests/runtests.sh passes
Test: Unit test
Test: Ran WifiManager ACTS tests locally.
Bug: 79400794
Change-Id: I1a02d70660ec54fda9a36399b285cda054cde8d3
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index bca20e43d..0b0210bee 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -3735,7 +3735,12 @@ public class WifiStateMachine extends StateMachine { mIsRunning = false; updateBatteryWorkSource(null); - if (mIpClient != null) mIpClient.shutdown(); + if (mIpClient != null) { + mIpClient.shutdown(); + // Block to make sure IpClient has really shut down, lest cleanup + // race with, say, bringup code over in tethering. + mIpClient.awaitShutdown(); + } mNetworkInfo.setIsAvailable(false); if (mNetworkAgent != null) mNetworkAgent.sendNetworkInfo(mNetworkInfo); mCountryCode.setReadyForChange(false); |