Merge "Verify network state of apps hosting fg-service and in idle state." am: 468293beef am: 7cb66673cc

Original change: https://android-review.googlesource.com/c/platform/cts/+/1455860

Change-Id: Iad434b5270372230b69c4c42e0a588d0db32d28a
This commit is contained in:
Sudheer Shanka
2020-10-13 00:30:15 +00:00
committed by Automerger Merge Worker

View File

@@ -78,6 +78,17 @@ abstract class AbstractAppIdleTestCase extends AbstractRestrictBackgroundNetwork
stopForegroundService();
assertAppIdle(true);
assertBackgroundNetworkAccess(false);
// Set Idle after foreground service start.
launchComponentAndAssertNetworkAccess(TYPE_COMPONENT_FOREGROUND_SERVICE);
setAppIdle(true);
addPowerSaveModeWhitelist(TEST_PKG);
removePowerSaveModeWhitelist(TEST_PKG);
assertForegroundServiceNetworkAccess();
stopForegroundService();
assertAppIdle(true);
assertBackgroundNetworkAccess(false);
}
@Test