From f8b75aa88a63fe15feb6efed338f49202ae4f78c Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Mon, 13 Oct 2014 14:13:07 -0400 Subject: [PATCH] Don't let NetworkMonitor state stop user-initiated transitions. GCM can call reportInetCondition() at any time which can cause the NetworkMonitor to transition states to reevaluate at any time. Previously we were only listening for users clicking the sign-in notificaiton or completing sign-in when in the appropriate state. With this change NetworkMonitor's state does not stop us from listening for the user's actions. bug:17917929 Change-Id: Ic1da31d90f7090e5fc111874cb7c37d505aaf590 --- .../android/server/connectivity/NetworkAgentInfo.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java index 4cf2a4acb8..0dd818f1a4 100644 --- a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +++ b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java @@ -45,7 +45,14 @@ public class NetworkAgentInfo { public NetworkCapabilities networkCapabilities; public final NetworkMonitor networkMonitor; public final NetworkMisc networkMisc; + // Indicates if netd has been told to create this Network. Once created the appropriate routing + // rules are setup and routes are added so packets can begin flowing over the Network. + // NOTE: This is a sticky bit; once set it is never cleared. public boolean created; + // Set to true if this Network successfully passed validation or if it did not satisfy the + // default NetworkRequest in which case validation will not be attempted. + // NOTE: This is a sticky bit; once set it is never cleared even if future validation attempts + // fail. public boolean validated; // This represents the last score received from the NetworkAgent. @@ -58,6 +65,9 @@ public class NetworkAgentInfo { // The list of NetworkRequests being satisfied by this Network. public final SparseArray networkRequests = new SparseArray(); + // The list of NetworkRequests that this Network previously satisfied with the highest + // score. A non-empty list indicates that if this Network was validated it is lingered. + // NOTE: This list is only used for debugging. public final ArrayList networkLingered = new ArrayList(); public final Messenger messenger;