Merge changes I3ba50cbd,I970ee365 into sc-dev

* changes:
  [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
  [FUI27] Fix internal naming of notifyNetworkStatus
This commit is contained in:
Junyu Lai
2021-05-19 12:36:03 +00:00
committed by Android (Google) Code Review
2 changed files with 28 additions and 31 deletions

View File

@@ -8584,11 +8584,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
final UnderlyingNetworkInfo[] underlyingNetworkInfos = getAllVpnInfo();
try {
final ArrayList<NetworkStateSnapshot> snapshots = new ArrayList<>();
// TODO: Directly use NetworkStateSnapshot when feasible.
for (final NetworkState state : getAllNetworkState()) {
final NetworkStateSnapshot snapshot = new NetworkStateSnapshot(state.network,
state.networkCapabilities, state.linkProperties, state.subscriberId,
state.legacyNetworkType);
for (final NetworkStateSnapshot snapshot : getAllNetworkStateSnapshots()) {
snapshots.add(snapshot);
}
mStatsManager.notifyNetworkStatus(getDefaultNetworks(),