Merge "Move some utils to a more appropriate package/directory"
diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractAppIdleTestCase.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractAppIdleTestCase.java
index d06ab13..2926336 100644
--- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractAppIdleTestCase.java
+++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractAppIdleTestCase.java
@@ -67,7 +67,7 @@
setAppIdle(true);
launchComponentAndAssertNetworkAccess(TYPE_COMPONENT_ACTIVTIY);
finishActivity();
- assertAppIdle(false); // Sanity check - not idle anymore, since activity was launched...
+ assertAppIdle(false); // verify - not idle anymore, since activity was launched...
assertBackgroundNetworkAccess(true);
setAppIdle(true);
assertBackgroundNetworkAccess(false);
@@ -86,24 +86,24 @@
assertBackgroundNetworkAccess(false);
addPowerSaveModeWhitelist(TEST_APP2_PKG);
- assertAppIdle(false); // Sanity check - not idle anymore, since whitelisted
+ assertAppIdle(false); // verify - not idle anymore, since whitelisted
assertBackgroundNetworkAccess(true);
removePowerSaveModeWhitelist(TEST_APP2_PKG);
- assertAppIdle(true); // Sanity check - idle again, once whitelisted was removed
+ assertAppIdle(true); // verify - idle again, once whitelisted was removed
assertBackgroundNetworkAccess(false);
addPowerSaveModeExceptIdleWhitelist(TEST_APP2_PKG);
- assertAppIdle(false); // Sanity check - not idle anymore, since whitelisted
+ assertAppIdle(false); // verify - not idle anymore, since whitelisted
assertBackgroundNetworkAccess(true);
removePowerSaveModeExceptIdleWhitelist(TEST_APP2_PKG);
- assertAppIdle(true); // Sanity check - idle again, once whitelisted was removed
+ assertAppIdle(true); // verify - idle again, once whitelisted was removed
assertBackgroundNetworkAccess(false);
assertsForegroundAlwaysHasNetworkAccess();
- // Sanity check - no whitelist, no access!
+ // verify - no whitelist, no access!
setAppIdle(true);
assertBackgroundNetworkAccess(false);
}
diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java
index 3efc6d0..e6f0c30 100644
--- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java
+++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java
@@ -240,12 +240,12 @@
}
protected void assertBackgroundNetworkAccess(boolean expectAllowed) throws Exception {
- assertBackgroundState(); // Sanity check.
+ assertBackgroundState();
assertNetworkAccess(expectAllowed /* expectAvailable */, false /* needScreenOn */);
}
protected void assertForegroundNetworkAccess() throws Exception {
- assertForegroundState(); // Sanity check.
+ assertForegroundState();
// We verified that app is in foreground state but if the screen turns-off while
// verifying for network access, the app will go into background state (in case app's
// foreground status was due to top activity). So, turn the screen on when verifying
@@ -254,7 +254,7 @@
}
protected void assertForegroundServiceNetworkAccess() throws Exception {
- assertForegroundServiceState(); // Sanity check.
+ assertForegroundServiceState();
assertNetworkAccess(true /* expectAvailable */, false /* needScreenOn */);
}
@@ -385,7 +385,7 @@
}
// Network status format is described on MyBroadcastReceiver.checkNetworkStatus()
final String[] parts = resultData.split(NETWORK_STATUS_SEPARATOR);
- assertEquals("Wrong network status: " + resultData, 5, parts.length); // Sanity check
+ assertEquals("Wrong network status: " + resultData, 5, parts.length);
final State state = parts[0].equals("null") ? null : State.valueOf(parts[0]);
final DetailedState detailedState = parts[1].equals("null")
? null : DetailedState.valueOf(parts[1]);
@@ -558,7 +558,7 @@
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
// need to use netpolicy for whitelisting
executeShellCommand("dumpsys deviceidle whitelist +" + packageName);
- assertPowerSaveModeWhitelist(packageName, true); // Sanity check
+ assertPowerSaveModeWhitelist(packageName, true);
}
protected void removePowerSaveModeWhitelist(String packageName) throws Exception {
@@ -566,7 +566,7 @@
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
// need to use netpolicy for whitelisting
executeShellCommand("dumpsys deviceidle whitelist -" + packageName);
- assertPowerSaveModeWhitelist(packageName, false); // Sanity check
+ assertPowerSaveModeWhitelist(packageName, false);
}
protected void assertPowerSaveModeExceptIdleWhitelist(String packageName, boolean expected)
@@ -582,7 +582,7 @@
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
// need to use netpolicy for whitelisting
executeShellCommand("dumpsys deviceidle except-idle-whitelist +" + packageName);
- assertPowerSaveModeExceptIdleWhitelist(packageName, true); // Sanity check
+ assertPowerSaveModeExceptIdleWhitelist(packageName, true);
}
protected void removePowerSaveModeExceptIdleWhitelist(String packageName) throws Exception {
@@ -591,7 +591,7 @@
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
// need to use netpolicy for whitelisting
executeShellCommand("dumpsys deviceidle except-idle-whitelist reset");
- assertPowerSaveModeExceptIdleWhitelist(packageName, false); // Sanity check
+ assertPowerSaveModeExceptIdleWhitelist(packageName, false);
}
protected void turnBatteryOn() throws Exception {
@@ -646,7 +646,7 @@
}
protected void setDozeMode(boolean enabled) throws Exception {
- // Sanity check, since tests should check beforehand....
+ // Check doze mode is supported.
assertTrue("Device does not support Doze Mode", isDozeModeSupported());
Log.i(TAG, "Setting Doze Mode to " + enabled);
@@ -659,7 +659,6 @@
turnBatteryOff();
executeShellCommand("dumpsys deviceidle unforce");
}
- // Sanity check.
assertDozeMode(enabled);
}
@@ -670,7 +669,7 @@
protected void setAppIdle(boolean enabled) throws Exception {
Log.i(TAG, "Setting app idle to " + enabled);
executeSilentShellCommand("am set-inactive " + TEST_APP2_PKG + " " + enabled );
- assertAppIdle(enabled); // Sanity check
+ assertAppIdle(enabled);
}
protected void assertAppIdle(boolean enabled) throws Exception {
diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/DataSaverModeTest.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/DataSaverModeTest.java
index aa2c914..604a0b6 100644
--- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/DataSaverModeTest.java
+++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/DataSaverModeTest.java
@@ -67,7 +67,7 @@
public void testGetRestrictBackgroundStatus_disabled() throws Exception {
assertDataSaverStatusOnBackground(RESTRICT_BACKGROUND_STATUS_DISABLED);
- // Sanity check: make sure status is always disabled, never whitelisted
+ // Verify status is always disabled, never whitelisted
addRestrictBackgroundWhitelist(mUid);
assertRestrictBackgroundChangedReceived(0);
assertDataSaverStatusOnBackground(RESTRICT_BACKGROUND_STATUS_DISABLED);
diff --git a/tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java b/tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
index 4598c39..ac28c7a 100644
--- a/tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
+++ b/tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
@@ -367,7 +367,7 @@
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
// need to use netpolicy for whitelisting
runCommand("dumpsys deviceidle whitelist +" + packageName);
- assertPowerSaveModeWhitelist(packageName, true); // Sanity check
+ assertPowerSaveModeWhitelist(packageName, true);
}
protected boolean isDozeModeEnabled() throws Exception {