Merge "Verify network state of apps hosting fg-service and in idle state."

This commit is contained in:
Sudheer Shanka
2020-10-12 23:31:17 +00:00
committed by Gerrit Code Review

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