Merge "Add getters to NetworkStateSnapshot"

This commit is contained in:
Treehugger Robot 2021-04-29 09:20:34 +00:00 • committed by Gerrit Code Review
commit 0c85894c8b

View file

@ -2179,11 +2179,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
for (NetworkStateSnapshot snapshot : getAllNetworkStateSnapshots()) {
// NetworkStateSnapshot doesn't contain NetworkInfo, so need to fetch it from the
// NetworkAgentInfo.
final NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(snapshot.network);
final NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(snapshot.getNetwork());
if (nai != null && nai.networkInfo.isConnected()) {
result.add(new NetworkState(new NetworkInfo(nai.networkInfo),
snapshot.linkProperties, snapshot.networkCapabilities, snapshot.network,
snapshot.subscriberId));
snapshot.getLinkProperties(), snapshot.getNetworkCapabilities(),
snapshot.getNetwork(), snapshot.getSubscriberId()));
}
}
return result.toArray(new NetworkState[result.size()]);