Rename getAllNetworkStateSnapshot which should be pluralized
Address API review feedback, ConnectivityManager#getAllNetworkStateSnapshot
should be pluralized so rename the method to getAllNetworkStateSnapshots
(cherry picked from ag/14221105)
Bug: 183972554
Test: make, FrameworksNetTests
FrameworksServicesTests
Merged-In: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
Change-Id: Ic18d17d05984fa2466c962c7843c0ef7183ce77c
This commit is contained in:
@@ -1803,7 +1803,7 @@ public class ConnectivityServiceTest {
|
||||
assertNull(mCm.getActiveNetworkForUid(Process.myUid()));
|
||||
// Test getAllNetworks()
|
||||
assertEmpty(mCm.getAllNetworks());
|
||||
assertEmpty(mCm.getAllNetworkStateSnapshot());
|
||||
assertEmpty(mCm.getAllNetworkStateSnapshots());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -11741,7 +11741,7 @@ public class ConnectivityServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAllNetworkStateSnapshot() throws Exception {
|
||||
public void testGetAllNetworkStateSnapshots() throws Exception {
|
||||
verifyNoNetwork();
|
||||
|
||||
// Setup test cellular network with specified LinkProperties and NetworkCapabilities,
|
||||
@@ -11765,7 +11765,7 @@ public class ConnectivityServiceTest {
|
||||
mCellNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_CELLULAR, cellLp, cellNcTemplate);
|
||||
mCellNetworkAgent.connect(true);
|
||||
cellCb.expectAvailableCallbacksUnvalidated(mCellNetworkAgent);
|
||||
List<NetworkStateSnapshot> snapshots = mCm.getAllNetworkStateSnapshot();
|
||||
List<NetworkStateSnapshot> snapshots = mCm.getAllNetworkStateSnapshots();
|
||||
assertLength(1, snapshots);
|
||||
|
||||
// Compose the expected cellular snapshot for verification.
|
||||
@@ -11787,7 +11787,7 @@ public class ConnectivityServiceTest {
|
||||
mWiFiNetworkAgent.getNetwork(), wifiNc, new LinkProperties(), null,
|
||||
ConnectivityManager.TYPE_WIFI);
|
||||
|
||||
snapshots = mCm.getAllNetworkStateSnapshot();
|
||||
snapshots = mCm.getAllNetworkStateSnapshots();
|
||||
assertLength(2, snapshots);
|
||||
assertContainsAll(snapshots, cellSnapshot, wifiSnapshot);
|
||||
|
||||
@@ -11796,20 +11796,20 @@ public class ConnectivityServiceTest {
|
||||
// temporary shortage of connectivity of a connected network.
|
||||
mCellNetworkAgent.suspend();
|
||||
waitForIdle();
|
||||
snapshots = mCm.getAllNetworkStateSnapshot();
|
||||
snapshots = mCm.getAllNetworkStateSnapshots();
|
||||
assertLength(1, snapshots);
|
||||
assertEquals(wifiSnapshot, snapshots.get(0));
|
||||
|
||||
// Disconnect wifi, verify the snapshots contain nothing.
|
||||
mWiFiNetworkAgent.disconnect();
|
||||
waitForIdle();
|
||||
snapshots = mCm.getAllNetworkStateSnapshot();
|
||||
snapshots = mCm.getAllNetworkStateSnapshots();
|
||||
assertEquals(mCellNetworkAgent.getNetwork(), mCm.getActiveNetwork());
|
||||
assertLength(0, snapshots);
|
||||
|
||||
mCellNetworkAgent.resume();
|
||||
waitForIdle();
|
||||
snapshots = mCm.getAllNetworkStateSnapshot();
|
||||
snapshots = mCm.getAllNetworkStateSnapshots();
|
||||
assertLength(1, snapshots);
|
||||
assertEquals(cellSnapshot, snapshots.get(0));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user