Add getters to NetworkStateSnapshot
Address API council feedback, add getters to NetworkStateSnapshot instead of exposing the bare fields directly. (cherry picked from ag/14233655) Bug: 183972826 Test: FrameworksNetTests Merged-In: Id1707753b42ae88d2b95e4bd00a792609434e4f5 Change-Id: Id1707753b42ae88d2b95e4bd00a792609434e4f5
This commit is contained in:
parent
935946812a
commit
b8f56644fb
1 changed files with 6 additions and 6 deletions
|
|
@ -2174,11 +2174,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
for (NetworkStateSnapshot snapshot : getAllNetworkStateSnapshot()) {
|
||||
// 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()]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue