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:
Aaron Huang
2021-04-20 17:19:46 +08:00
parent 935946812a
commit b8f56644fb
2 changed files with 6 additions and 6 deletions

View File

@@ -889,7 +889,7 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
final LinkProperties stackedProp = new LinkProperties();
stackedProp.setInterfaceName(stackedIface);
final NetworkStateSnapshot wifiState = buildWifiState();
wifiState.linkProperties.addStackedLink(stackedProp);
wifiState.getLinkProperties().addStackedLink(stackedProp);
NetworkStateSnapshot[] states = new NetworkStateSnapshot[] {wifiState};
expectNetworkStatsSummary(buildEmptyStats());
@@ -1580,10 +1580,10 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
}
private String getActiveIface(NetworkStateSnapshot... states) throws Exception {
if (states == null || states.length == 0 || states[0].linkProperties == null) {
if (states == null || states.length == 0 || states[0].getLinkProperties() == null) {
return null;
}
return states[0].linkProperties.getInterfaceName();
return states[0].getLinkProperties().getInterfaceName();
}
private void expectNetworkStatsSummary(NetworkStats summary) throws Exception {