Loading services/core/java/com/android/server/ConnectivityService.java +4 −2 Original line number Diff line number Diff line Loading @@ -1982,7 +1982,7 @@ public class ConnectivityService extends IConnectivityManager.Stub if (msg.arg1 == 0) { setProvNotificationVisibleIntent(false, msg.arg2, 0, null, null); } else { NetworkAgentInfo nai = null; final NetworkAgentInfo nai; synchronized (mNetworkForNetId) { nai = mNetworkForNetId.get(msg.arg2); } Loading @@ -1990,6 +1990,7 @@ public class ConnectivityService extends IConnectivityManager.Stub loge("EVENT_PROVISIONING_NOTIFICATION from unknown NetworkMonitor"); break; } nai.captivePortalDetected = true; setProvNotificationVisibleIntent(true, msg.arg2, nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(), (PendingIntent)msg.obj); } Loading Loading @@ -2384,7 +2385,8 @@ public class ConnectivityService extends IConnectivityManager.Stub // Only prompt if the network is unvalidated and was explicitly selected by the user, and if // we haven't already been told to switch to it regardless of whether it validated or not. if (nai == null || nai.everValidated || // Also don't prompt on captive portals because we're already prompting the user to sign in. if (nai == null || nai.everValidated || nai.captivePortalDetected || !nai.networkMisc.explicitlySelected || nai.networkMisc.acceptUnvalidated) { return; } Loading services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +7 −6 Original line number Diff line number Diff line Loading @@ -50,12 +50,11 @@ public class NetworkAgentInfo { 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. // 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. // This is a sticky bit; once set it is never cleared even if future validation attempts fail. public boolean everValidated; // The result of the last validation attempt on this network (true if validated, false if not). Loading @@ -65,6 +64,10 @@ public class NetworkAgentInfo { // TODO: Fix the network scoring code, remove this, and rename everValidated to validated. public boolean lastValidated; // Whether a captive portal was ever detected on this network. // This is a sticky bit; once set it is never cleared. public boolean captivePortalDetected; // This represents the last score received from the NetworkAgent. private int currentScore; // Penalty applied to scores of Networks that have not been validated. Loading Loading @@ -101,9 +104,6 @@ public class NetworkAgentInfo { currentScore = score; networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest); networkMisc = misc; created = false; everValidated = false; lastValidated = false; } public void addRequest(NetworkRequest networkRequest) { Loading Loading @@ -166,6 +166,7 @@ public class NetworkAgentInfo { "created{" + created + "} " + "explicitlySelected{" + networkMisc.explicitlySelected + "} " + "acceptUnvalidated{" + networkMisc.acceptUnvalidated + "} " + "captivePortalDetected{" + captivePortalDetected + "} " + "}"; } Loading Loading
services/core/java/com/android/server/ConnectivityService.java +4 −2 Original line number Diff line number Diff line Loading @@ -1982,7 +1982,7 @@ public class ConnectivityService extends IConnectivityManager.Stub if (msg.arg1 == 0) { setProvNotificationVisibleIntent(false, msg.arg2, 0, null, null); } else { NetworkAgentInfo nai = null; final NetworkAgentInfo nai; synchronized (mNetworkForNetId) { nai = mNetworkForNetId.get(msg.arg2); } Loading @@ -1990,6 +1990,7 @@ public class ConnectivityService extends IConnectivityManager.Stub loge("EVENT_PROVISIONING_NOTIFICATION from unknown NetworkMonitor"); break; } nai.captivePortalDetected = true; setProvNotificationVisibleIntent(true, msg.arg2, nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(), (PendingIntent)msg.obj); } Loading Loading @@ -2384,7 +2385,8 @@ public class ConnectivityService extends IConnectivityManager.Stub // Only prompt if the network is unvalidated and was explicitly selected by the user, and if // we haven't already been told to switch to it regardless of whether it validated or not. if (nai == null || nai.everValidated || // Also don't prompt on captive portals because we're already prompting the user to sign in. if (nai == null || nai.everValidated || nai.captivePortalDetected || !nai.networkMisc.explicitlySelected || nai.networkMisc.acceptUnvalidated) { return; } Loading
services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +7 −6 Original line number Diff line number Diff line Loading @@ -50,12 +50,11 @@ public class NetworkAgentInfo { 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. // 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. // This is a sticky bit; once set it is never cleared even if future validation attempts fail. public boolean everValidated; // The result of the last validation attempt on this network (true if validated, false if not). Loading @@ -65,6 +64,10 @@ public class NetworkAgentInfo { // TODO: Fix the network scoring code, remove this, and rename everValidated to validated. public boolean lastValidated; // Whether a captive portal was ever detected on this network. // This is a sticky bit; once set it is never cleared. public boolean captivePortalDetected; // This represents the last score received from the NetworkAgent. private int currentScore; // Penalty applied to scores of Networks that have not been validated. Loading Loading @@ -101,9 +104,6 @@ public class NetworkAgentInfo { currentScore = score; networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest); networkMisc = misc; created = false; everValidated = false; lastValidated = false; } public void addRequest(NetworkRequest networkRequest) { Loading Loading @@ -166,6 +166,7 @@ public class NetworkAgentInfo { "created{" + created + "} " + "explicitlySelected{" + networkMisc.explicitlySelected + "} " + "acceptUnvalidated{" + networkMisc.acceptUnvalidated + "} " + "captivePortalDetected{" + captivePortalDetected + "} " + "}"; } Loading