Merge "Include suspended network when getAllNetworkStateSnapshots"

This commit is contained in:
Junyu Lai 2021-09-09 09:24:04 +00:00 • committed by Gerrit Code Review
commit 48426bb2a4

View file

@ -2311,9 +2311,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
final ArrayList<NetworkStateSnapshot> result = new ArrayList<>();
for (Network network : getAllNetworks()) {
final NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network);
// TODO: Consider include SUSPENDED networks, which should be considered as
// temporary shortage of connectivity of a connected network.
if (nai != null && nai.networkInfo.isConnected()) {
if (nai != null && nai.everConnected) {
// TODO (b/73321673) : NetworkStateSnapshot contains a copy of the
// NetworkCapabilities, which may contain UIDs of apps to which the
// network applies. Should the UIDs be cleared so as not to leak or