Merge "Never satisfy requests with networks that aren't connected."

This commit is contained in:
Treehugger Robot
2022-08-29 08:30:31 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 13 deletions

View File

@@ -7470,9 +7470,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
notifyIfacesChangedForNetworkStats();
networkAgent.networkMonitor().notifyLinkPropertiesChanged(
new LinkProperties(newLp, true /* parcelSensitiveFields */));
if (networkAgent.everConnected) {
notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_IP_CHANGED);
}
notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_IP_CHANGED);
}
mKeepaliveTracker.handleCheckKeepalivesStillValid(networkAgent);
@@ -8732,9 +8730,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
// Gather the list of all relevant agents.
final ArrayList<NetworkAgentInfo> nais = new ArrayList<>();
for (final NetworkAgentInfo nai : mNetworkAgentInfos) {
if (!nai.everConnected) {
continue;
}
nais.add(nai);
}
@@ -8858,7 +8853,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
for (final NetworkAgentInfo nai : nais) {
if (!nai.everConnected) continue;
final boolean oldBackground = oldBgNetworks.contains(nai);
// Process listen requests and update capabilities if the background state has
// changed for this network. For consistency with previous behavior, send onLost
@@ -9451,7 +9445,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
}
for (NetworkAgentInfo nai : mNetworkAgentInfos) {
if (nai.everConnected && (activeNetIds.contains(nai.network().netId) || nai.isVPN())) {
if (activeNetIds.contains(nai.network().netId) || nai.isVPN()) {
defaultNetworks.add(nai.network);
}
}