Loading services/core/java/com/android/server/ConnectivityService.java +5 −4 Original line number Diff line number Diff line Loading @@ -1048,7 +1048,7 @@ public class ConnectivityService extends IConnectivityManager.Stub synchronized (nai) { if (nai.created) { NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities); if (nai.everValidated) { if (nai.lastValidated) { nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); } else { nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); Loading Loading @@ -1954,6 +1954,7 @@ public class ConnectivityService extends IConnectivityManager.Stub NetworkAgentInfo nai = (NetworkAgentInfo)msg.obj; if (isLiveNetworkAgent(nai, "EVENT_NETWORK_VALIDATED")) { boolean valid = (msg.arg1 == NetworkMonitor.NETWORK_TEST_RESULT_VALID); nai.lastValidated = valid; if (valid) { if (DBG) log("Validated " + nai.name()); if (!nai.everValidated) { Loading @@ -1964,7 +1965,7 @@ public class ConnectivityService extends IConnectivityManager.Stub sendUpdatedScoreToFactories(nai); } } updateInetCondition(nai, valid); updateInetCondition(nai); // Let the NetworkAgent know the state of its network nai.asyncChannel.sendMessage( android.net.NetworkAgent.CMD_REPORT_NETWORK_STATUS, Loading Loading @@ -4200,14 +4201,14 @@ public class ConnectivityService extends IConnectivityManager.Stub } } private void updateInetCondition(NetworkAgentInfo nai, boolean valid) { private void updateInetCondition(NetworkAgentInfo nai) { // Don't bother updating until we've graduated to validated at least once. 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; int newInetCondition = valid ? 100 : 0; int newInetCondition = nai.lastValidated ? 100 : 0; // Don't repeat publish. if (newInetCondition == mDefaultInetConditionPublished) return; Loading services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +11 −2 Original line number Diff line number Diff line Loading @@ -55,6 +55,13 @@ public class NetworkAgentInfo { // fail. public boolean everValidated; // The result of the last validation attempt on this network (true if validated, false if not). // This bit exists only because we never unvalidate a network once it's been validated, and that // is because the network scoring and revalidation code does not (may not?) deal properly with // networks becoming unvalidated. // TODO: Fix the network scoring code, remove this, and rename everValidated to validated. public boolean lastValidated; // 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 @@ -90,6 +97,7 @@ public class NetworkAgentInfo { networkMisc = misc; created = false; everValidated = false; lastValidated = false; } public void addRequest(NetworkRequest networkRequest) { Loading Loading @@ -143,7 +151,8 @@ public class NetworkAgentInfo { network + "} lp{" + linkProperties + "} nc{" + networkCapabilities + "} Score{" + getCurrentScore() + "} " + "everValidated{" + everValidated + "} created{" + created + "} " + "everValidated{" + everValidated + "} lastValidated{" + lastValidated + "} " + "created{" + created + "} " + "explicitlySelected{" + networkMisc.explicitlySelected + "} }"; } Loading Loading
services/core/java/com/android/server/ConnectivityService.java +5 −4 Original line number Diff line number Diff line Loading @@ -1048,7 +1048,7 @@ public class ConnectivityService extends IConnectivityManager.Stub synchronized (nai) { if (nai.created) { NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities); if (nai.everValidated) { if (nai.lastValidated) { nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); } else { nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); Loading Loading @@ -1954,6 +1954,7 @@ public class ConnectivityService extends IConnectivityManager.Stub NetworkAgentInfo nai = (NetworkAgentInfo)msg.obj; if (isLiveNetworkAgent(nai, "EVENT_NETWORK_VALIDATED")) { boolean valid = (msg.arg1 == NetworkMonitor.NETWORK_TEST_RESULT_VALID); nai.lastValidated = valid; if (valid) { if (DBG) log("Validated " + nai.name()); if (!nai.everValidated) { Loading @@ -1964,7 +1965,7 @@ public class ConnectivityService extends IConnectivityManager.Stub sendUpdatedScoreToFactories(nai); } } updateInetCondition(nai, valid); updateInetCondition(nai); // Let the NetworkAgent know the state of its network nai.asyncChannel.sendMessage( android.net.NetworkAgent.CMD_REPORT_NETWORK_STATUS, Loading Loading @@ -4200,14 +4201,14 @@ public class ConnectivityService extends IConnectivityManager.Stub } } private void updateInetCondition(NetworkAgentInfo nai, boolean valid) { private void updateInetCondition(NetworkAgentInfo nai) { // Don't bother updating until we've graduated to validated at least once. 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; int newInetCondition = valid ? 100 : 0; int newInetCondition = nai.lastValidated ? 100 : 0; // Don't repeat publish. if (newInetCondition == mDefaultInetConditionPublished) return; Loading
services/core/java/com/android/server/connectivity/NetworkAgentInfo.java +11 −2 Original line number Diff line number Diff line Loading @@ -55,6 +55,13 @@ public class NetworkAgentInfo { // fail. public boolean everValidated; // The result of the last validation attempt on this network (true if validated, false if not). // This bit exists only because we never unvalidate a network once it's been validated, and that // is because the network scoring and revalidation code does not (may not?) deal properly with // networks becoming unvalidated. // TODO: Fix the network scoring code, remove this, and rename everValidated to validated. public boolean lastValidated; // 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 @@ -90,6 +97,7 @@ public class NetworkAgentInfo { networkMisc = misc; created = false; everValidated = false; lastValidated = false; } public void addRequest(NetworkRequest networkRequest) { Loading Loading @@ -143,7 +151,8 @@ public class NetworkAgentInfo { network + "} lp{" + linkProperties + "} nc{" + networkCapabilities + "} Score{" + getCurrentScore() + "} " + "everValidated{" + everValidated + "} created{" + created + "} " + "everValidated{" + everValidated + "} lastValidated{" + lastValidated + "} " + "created{" + created + "} " + "explicitlySelected{" + networkMisc.explicitlySelected + "} }"; } Loading