Rename validated to everValidated.
This is a straight rename and thus a complete no-op from a functionality perspective. Bug: 18777225 Change-Id: I140d7640f1460c869a311294873772819a7a7059
This commit is contained in:
@@ -1048,7 +1048,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
synchronized (nai) {
|
synchronized (nai) {
|
||||||
if (nai.created) {
|
if (nai.created) {
|
||||||
NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities);
|
NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities);
|
||||||
if (nai.validated) {
|
if (nai.everValidated) {
|
||||||
nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
|
nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
|
||||||
} else {
|
} else {
|
||||||
nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
|
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);
|
boolean valid = (msg.arg1 == NetworkMonitor.NETWORK_TEST_RESULT_VALID);
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (DBG) log("Validated " + nai.name());
|
if (DBG) log("Validated " + nai.name());
|
||||||
if (!nai.validated) {
|
if (!nai.everValidated) {
|
||||||
nai.validated = true;
|
nai.everValidated = true;
|
||||||
rematchNetworkAndRequests(nai, NascentState.JUST_VALIDATED,
|
rematchNetworkAndRequests(nai, NascentState.JUST_VALIDATED,
|
||||||
ReapUnvalidatedNetworks.REAP);
|
ReapUnvalidatedNetworks.REAP);
|
||||||
// If score has changed, rebroadcast to NetworkFactories. b/17726566
|
// 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,
|
private void rematchNetworkAndRequests(NetworkAgentInfo newNetwork, NascentState nascent,
|
||||||
ReapUnvalidatedNetworks reapUnvalidatedNetworks) {
|
ReapUnvalidatedNetworks reapUnvalidatedNetworks) {
|
||||||
if (!newNetwork.created) return;
|
if (!newNetwork.created) return;
|
||||||
if (nascent == NascentState.JUST_VALIDATED && !newNetwork.validated) {
|
if (nascent == NascentState.JUST_VALIDATED && !newNetwork.everValidated) {
|
||||||
loge("ERROR: nascent network not validated.");
|
loge("ERROR: nascent network not validated.");
|
||||||
}
|
}
|
||||||
boolean keep = newNetwork.isVPN();
|
boolean keep = newNetwork.isVPN();
|
||||||
@@ -4054,7 +4054,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
// Linger any networks that are no longer needed.
|
// Linger any networks that are no longer needed.
|
||||||
for (NetworkAgentInfo nai : affectedNetworks) {
|
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++) {
|
for (int i = 0; i < nai.networkRequests.size() && teardown; i++) {
|
||||||
NetworkRequest nr = nai.networkRequests.valueAt(i);
|
NetworkRequest nr = nai.networkRequests.valueAt(i);
|
||||||
try {
|
try {
|
||||||
@@ -4096,7 +4096,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
mLegacyTypeTracker.remove(oldDefaultNetwork.networkInfo.getType(),
|
mLegacyTypeTracker.remove(oldDefaultNetwork.networkInfo.getType(),
|
||||||
oldDefaultNetwork);
|
oldDefaultNetwork);
|
||||||
}
|
}
|
||||||
mDefaultInetConditionPublished = newNetwork.validated ? 100 : 0;
|
mDefaultInetConditionPublished = newNetwork.everValidated ? 100 : 0;
|
||||||
mLegacyTypeTracker.add(newNetwork.networkInfo.getType(), newNetwork);
|
mLegacyTypeTracker.add(newNetwork.networkInfo.getType(), newNetwork);
|
||||||
notifyLockdownVpn(newNetwork);
|
notifyLockdownVpn(newNetwork);
|
||||||
}
|
}
|
||||||
@@ -4139,7 +4139,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
if (reapUnvalidatedNetworks == ReapUnvalidatedNetworks.REAP) {
|
if (reapUnvalidatedNetworks == ReapUnvalidatedNetworks.REAP) {
|
||||||
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
|
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
|
||||||
if (!nai.created || nai.validated || nai.isVPN()) continue;
|
if (!nai.created || nai.everValidated || nai.isVPN()) continue;
|
||||||
boolean reap = true;
|
boolean reap = true;
|
||||||
for (NetworkRequestInfo nri : mNetworkRequests.values()) {
|
for (NetworkRequestInfo nri : mNetworkRequests.values()) {
|
||||||
// If this Network is already the highest scoring Network for a request, or if
|
// 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) {
|
private void updateInetCondition(NetworkAgentInfo nai, boolean valid) {
|
||||||
// Don't bother updating until we've graduated to validated at least once.
|
// 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.
|
// For now only update icons for default connection.
|
||||||
// TODO: Update WiFi and cellular icons separately. b/17237507
|
// TODO: Update WiFi and cellular icons separately. b/17237507
|
||||||
if (!isDefaultNetwork(nai)) return;
|
if (!isDefaultNetwork(nai)) return;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class NetworkAgentInfo {
|
|||||||
// default NetworkRequest in which case validation will not be attempted.
|
// 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
|
// NOTE: This is a sticky bit; once set it is never cleared even if future validation attempts
|
||||||
// fail.
|
// fail.
|
||||||
public boolean validated;
|
public boolean everValidated;
|
||||||
|
|
||||||
// This represents the last score received from the NetworkAgent.
|
// This represents the last score received from the NetworkAgent.
|
||||||
private int currentScore;
|
private int currentScore;
|
||||||
@@ -89,7 +89,7 @@ public class NetworkAgentInfo {
|
|||||||
networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest);
|
networkMonitor = new NetworkMonitor(context, handler, this, defaultRequest);
|
||||||
networkMisc = misc;
|
networkMisc = misc;
|
||||||
created = false;
|
created = false;
|
||||||
validated = false;
|
everValidated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRequest(NetworkRequest networkRequest) {
|
public void addRequest(NetworkRequest networkRequest) {
|
||||||
@@ -114,7 +114,7 @@ public class NetworkAgentInfo {
|
|||||||
|
|
||||||
int score = currentScore;
|
int score = currentScore;
|
||||||
|
|
||||||
if (!validated && !pretendValidated) score -= UNVALIDATED_SCORE_PENALTY;
|
if (!everValidated && !pretendValidated) score -= UNVALIDATED_SCORE_PENALTY;
|
||||||
if (score < 0) score = 0;
|
if (score < 0) score = 0;
|
||||||
|
|
||||||
if (networkMisc.explicitlySelected) score = EXPLICITLY_SELECTED_NETWORK_SCORE;
|
if (networkMisc.explicitlySelected) score = EXPLICITLY_SELECTED_NETWORK_SCORE;
|
||||||
@@ -143,7 +143,7 @@ public class NetworkAgentInfo {
|
|||||||
network + "} lp{" +
|
network + "} lp{" +
|
||||||
linkProperties + "} nc{" +
|
linkProperties + "} nc{" +
|
||||||
networkCapabilities + "} Score{" + getCurrentScore() + "} " +
|
networkCapabilities + "} Score{" + getCurrentScore() + "} " +
|
||||||
"validated{" + validated + "} created{" + created + "} " +
|
"everValidated{" + everValidated + "} created{" + created + "} " +
|
||||||
"explicitlySelected{" + networkMisc.explicitlySelected + "} }";
|
"explicitlySelected{" + networkMisc.explicitlySelected + "} }";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user