From e1d6c4d640681da569b5071dbaedb062b18b585d Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Mon, 1 Apr 2019 13:04:07 +0900 Subject: Cleanup SystemReady in the network stack The system server (in SystemServer.java) defines the boot sequence, during which an event called SystemReady happens. This corresponds to a time when critical system services that are depended upon by other components in the system server are ready to handle requests from their dependencies. Some system services are listening to this event to defer initializations that depend on the critical services. Because the network stack is only started after SystemReady, there is no way any NetworkMonitor may be started before SystemReady. Remove the associated mechanism. Fix: 129376083 Test: FrameworksNetTests Change-Id: I071eeb10d0b7c4f71af6653d322c7b442b2cc7ee --- src/com/android/server/NetworkStackService.java | 6 ------ src/com/android/server/connectivity/NetworkMonitor.java | 15 --------------- 2 files changed, 21 deletions(-) (limited to 'src') diff --git a/src/com/android/server/NetworkStackService.java b/src/com/android/server/NetworkStackService.java index 63f057c..a0a90fd 100644 --- a/src/com/android/server/NetworkStackService.java +++ b/src/com/android/server/NetworkStackService.java @@ -302,12 +302,6 @@ public class NetworkStackService extends Service { mNm.notifyDnsResponse(returnCode); } - @Override - public void notifySystemReady() { - checkNetworkStackCallingPermission(); - mNm.notifySystemReady(); - } - @Override public void notifyNetworkConnected(LinkProperties lp, NetworkCapabilities nc) { checkNetworkStackCallingPermission(); diff --git a/src/com/android/server/connectivity/NetworkMonitor.java b/src/com/android/server/connectivity/NetworkMonitor.java index c000fc6..6f31f9b 100644 --- a/src/com/android/server/connectivity/NetworkMonitor.java +++ b/src/com/android/server/connectivity/NetworkMonitor.java @@ -298,8 +298,6 @@ public class NetworkMonitor extends StateMachine { // Avoids surfacing "Sign in to network" notification. private boolean mDontDisplaySigninNotification = false; - private volatile boolean mSystemReady = false; - private final State mDefaultState = new DefaultState(); private final State mValidatedState = new ValidatedState(); private final State mMaybeNotifyState = new MaybeNotifyState(); @@ -433,15 +431,6 @@ public class NetworkMonitor extends StateMachine { sendMessage(CMD_PRIVATE_DNS_SETTINGS_CHANGED, newCfg); } - /** - * Send a notification to NetworkMonitor indicating that the system is ready. - */ - public void notifySystemReady() { - // No need to run on the handler thread: mSystemReady is volatile and read only once on the - // isCaptivePortal() thread. - mSystemReady = true; - } - /** * Send a notification to NetworkMonitor indicating that the network is now connected. */ @@ -1592,10 +1581,6 @@ public class NetworkMonitor extends StateMachine { */ private void sendNetworkConditionsBroadcast(boolean responseReceived, boolean isCaptivePortal, long requestTimestampMs, long responseTimestampMs) { - if (!mSystemReady) { - return; - } - Intent latencyBroadcast = new Intent(NetworkMonitorUtils.ACTION_NETWORK_CONDITIONS_MEASURED); if (mNetworkCapabilities.hasTransport(TRANSPORT_WIFI)) { -- cgit v1.2.3