Fix testGetAllNetworkStateSnapshots for non-cellular

bug: 192115694
Test: atest ConnectivityManagerTest#testGetAllNetworkStateSnapshots
Original-Change: https://android-review.googlesource.com/1749483
Merged-In: Ie7f637248302f3e6b61be69ef4c6a7a906e69275
Change-Id: Ie7f637248302f3e6b61be69ef4c6a7a906e69275
This commit is contained in:
Treehugger Robot
2021-07-01 07:50:55 +00:00
committed by Junyu Lai
parent 424ef2043c
commit 21ec633e39

View File

@@ -506,6 +506,7 @@ public class ConnectivityManagerTest {
@Test @Test
public void testGetAllNetworkStateSnapshots() public void testGetAllNetworkStateSnapshots()
throws InterruptedException { throws InterruptedException {
assumeTrue(mPackageManager.hasSystemFeature(FEATURE_TELEPHONY));
// Make sure cell is active to retrieve IMSI for verification in later step. // Make sure cell is active to retrieve IMSI for verification in later step.
final Network cellNetwork = mCtsNetUtils.connectToCell(); final Network cellNetwork = mCtsNetUtils.connectToCell();
final String subscriberId = getSubscriberIdForCellNetwork(cellNetwork); final String subscriberId = getSubscriberIdForCellNetwork(cellNetwork);