Merge "Include suspended network when getAllNetworkStateSnapshots" am: 48426bb2a4

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1797867

Change-Id: I700e16334e0f8aeea862555e8ecf784cf36fd315
This commit is contained in:
Junyu Lai
2021-09-09 09:40:15 +00:00
committed by Automerger Merge Worker
2 changed files with 19 additions and 16 deletions

View File

@@ -2319,9 +2319,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