Merge "[NS A11] Small refactor"

am: a8e2afde61

Change-Id: I317e6b99a51ddb0a3e49b08c595eb42f4edad1e9
This commit is contained in:
Chalard Jean
2019-11-25 06:09:17 -08:00
committed by android-build-merger

View File

@@ -6353,7 +6353,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
private void rematchNetworkAndRequests(NetworkAgentInfo newNetwork, long now) {
ensureRunningOnConnectivityServiceThread();
if (!newNetwork.everConnected) return;
boolean keep = newNetwork.isVPN();
boolean isNewDefault = false;
NetworkAgentInfo oldDefaultNetwork = null;
@@ -6395,7 +6394,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
Slog.wtf(TAG, "BUG: " + newSatisfier.name() + " already has " + nri.request);
}
addedRequests.add(nri);
keep = true;
// Tell NetworkFactories about the new score, so they can stop
// trying to connect if they know they cannot match it.
// TODO - this could get expensive if we have a lot of requests for this
@@ -6502,7 +6500,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
notifyLockdownVpn(newNetwork);
}
if (keep) {
if (reassignedRequests.containsValue(newNetwork) || newNetwork.isVPN()) {
// Notify battery stats service about this network, both the normal
// interface and any stacked links.
// TODO: Avoid redoing this; this must only be done once when a network comes online.