From a8de5ca5ccf07158350d9c0977d55b540fa42a56 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Wed, 17 Dec 2014 11:14:42 +0900 Subject: [PATCH] Rename validated to everValidated. This is a straight rename and thus a complete no-op from a functionality perspective. Bug: 18777225 Change-Id: I140d7640f1460c869a311294873772819a7a7059 --- .../com/android/server/ConnectivityService.java | 16 ++++++++-------- .../server/connectivity/NetworkAgentInfo.java | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 788b5d3552..3387c0f190 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -1048,7 +1048,7 @@ public class ConnectivityService extends IConnectivityManager.Stub synchronized (nai) { if (nai.created) { NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities); - if (nai.validated) { + if (nai.everValidated) { nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); } else { nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); @@ -1956,8 +1956,8 @@ public class ConnectivityService extends IConnectivityManager.Stub boolean valid = (msg.arg1 == NetworkMonitor.NETWORK_TEST_RESULT_VALID); if (valid) { if (DBG) log("Validated " + nai.name()); - if (!nai.validated) { - nai.validated = true; + if (!nai.everValidated) { + nai.everValidated = true; rematchNetworkAndRequests(nai, NascentState.JUST_VALIDATED, ReapUnvalidatedNetworks.REAP); // If score has changed, rebroadcast to NetworkFactories. b/17726566 @@ -3984,7 +3984,7 @@ public class ConnectivityService extends IConnectivityManager.Stub private void rematchNetworkAndRequests(NetworkAgentInfo newNetwork, NascentState nascent, ReapUnvalidatedNetworks reapUnvalidatedNetworks) { if (!newNetwork.created) return; - if (nascent == NascentState.JUST_VALIDATED && !newNetwork.validated) { + if (nascent == NascentState.JUST_VALIDATED && !newNetwork.everValidated) { loge("ERROR: nascent network not validated."); } boolean keep = newNetwork.isVPN(); @@ -4054,7 +4054,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } // Linger any networks that are no longer needed. for (NetworkAgentInfo nai : affectedNetworks) { - boolean teardown = !nai.isVPN() && nai.validated; + boolean teardown = !nai.isVPN() && nai.everValidated; for (int i = 0; i < nai.networkRequests.size() && teardown; i++) { NetworkRequest nr = nai.networkRequests.valueAt(i); try { @@ -4096,7 +4096,7 @@ public class ConnectivityService extends IConnectivityManager.Stub mLegacyTypeTracker.remove(oldDefaultNetwork.networkInfo.getType(), oldDefaultNetwork); } - mDefaultInetConditionPublished = newNetwork.validated ? 100 : 0; + mDefaultInetConditionPublished = newNetwork.everValidated ? 100 : 0; mLegacyTypeTracker.add(newNetwork.networkInfo.getType(), newNetwork); notifyLockdownVpn(newNetwork); } @@ -4139,7 +4139,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } if (reapUnvalidatedNetworks == ReapUnvalidatedNetworks.REAP) { for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) { - if (!nai.created || nai.validated || nai.isVPN()) continue; + if (!nai.created || nai.everValidated || nai.isVPN()) continue; boolean reap = true; for (NetworkRequestInfo nri : mNetworkRequests.values()) { // If this Network is already the highest scoring Network for a request, or if @@ -4202,7 +4202,7 @@ public class ConnectivityService extends IConnectivityManager.Stub private void updateInetCondition(NetworkAgentInfo nai, boolean valid) { // Don't bother updating until we've graduated to validated at least once. - if (!nai.validated) return; + if (!nai.everValidated) return; // For now only update icons for default connection. // TODO: Update WiFi and cellular icons separately. b/17237507 if (!isDefaultNetwork(nai)) return; diff --git a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java index 779a834f69..94a8c0f215 100644 --- a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +++ b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java @@ -53,7 +53,7 @@ public class NetworkAgentInfo { // 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; + public boolean everValidated; // This represents the last score received from the NetworkAgent. private int currentScore; @@ -89,7 +89,7 @@ public class NetworkAgentInfo { networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest); networkMisc = misc; created = false; - validated = false; + everValidated = false; } public void addRequest(NetworkRequest networkRequest) { @@ -114,7 +114,7 @@ public class NetworkAgentInfo { int score = currentScore; - if (!validated && !pretendValidated) score -= UNVALIDATED_SCORE_PENALTY; + if (!everValidated && !pretendValidated) score -= UNVALIDATED_SCORE_PENALTY; if (score < 0) score = 0; if (networkMisc.explicitlySelected) score = EXPLICITLY_SELECTED_NETWORK_SCORE; @@ -143,7 +143,7 @@ public class NetworkAgentInfo { network + "} lp{" + linkProperties + "} nc{" + networkCapabilities + "} Score{" + getCurrentScore() + "} " + - "validated{" + validated + "} created{" + created + "} " + + "everValidated{" + everValidated + "} created{" + created + "} " + "explicitlySelected{" + networkMisc.explicitlySelected + "} }"; }