diff --git a/tests/cts/hostside/AndroidTest.xml b/tests/cts/hostside/AndroidTest.xml
index 5479c51a4c..6ba6f42409 100644
--- a/tests/cts/hostside/AndroidTest.xml
+++ b/tests/cts/hostside/AndroidTest.xml
@@ -20,8 +20,6 @@
-
-
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 d06ab13b3b..51bdf8e502 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
@@ -131,11 +131,11 @@ abstract class AbstractAppIdleTestCase extends AbstractRestrictBackgroundNetwork
@RequiredProperties({BATTERY_SAVER_MODE})
@Test
public void testAppIdleNetworkAccess_whenCharging() throws Exception {
- // Check that app is paroled when charging
+ // Check that idle app doesn't get network when charging
setAppIdle(true);
assertBackgroundNetworkAccess(false);
turnBatteryOff();
- assertBackgroundNetworkAccess(true);
+ assertBackgroundNetworkAccess(false);
turnBatteryOn();
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 57b7bb4f8d..529b64013c 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
@@ -164,14 +164,6 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
Log.i(TAG, "Apps status:\n"
+ "\ttest app: uid=" + mMyUid + ", state=" + getProcessStateByUid(mMyUid) + "\n"
+ "\tapp2: uid=" + mUid + ", state=" + getProcessStateByUid(mUid));
-
- // app_idle_constants set in NetPolicyTestsPreparer.setUp() is not always sucessful (suspect
- // timing issue), here we set it again to make sure.
- final String appIdleConstants = "parole_duration=0,stable_charging_threshold=0";
- executeShellCommand("settings put global app_idle_constants " + appIdleConstants);
- final String currentConstants =
- executeShellCommand("settings get global app_idle_constants");
- assertEquals(appIdleConstants, currentConstants);
}
protected void tearDown() throws Exception {
diff --git a/tests/cts/hostside/src/com/android/cts/net/NetPolicyTestsPreparer.java b/tests/cts/hostside/src/com/android/cts/net/NetPolicyTestsPreparer.java
deleted file mode 100644
index bc2ee2cf7a..0000000000
--- a/tests/cts/hostside/src/com/android/cts/net/NetPolicyTestsPreparer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.cts.net;
-
-import com.android.tradefed.build.IBuildInfo;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.log.LogUtil;
-import com.android.tradefed.targetprep.ITargetCleaner;
-import com.android.tradefed.targetprep.ITargetPreparer;
-
-public class NetPolicyTestsPreparer implements ITargetPreparer, ITargetCleaner {
- private final static String KEY_PAROLE_DURATION = "parole_duration";
- private final static int DESIRED_PAROLE_DURATION = 0;
- private final static String KEY_STABLE_CHARGING_THRESHOLD = "stable_charging_threshold";
- private final static int DESIRED_STABLE_CHARGING_THRESHOLD = 0;
-
- private ITestDevice mDevice;
- private String mOriginalAppIdleConsts;
-
- @Override
- public void setUp(ITestDevice device, IBuildInfo buildInfo) throws DeviceNotAvailableException {
- mDevice = device;
- mOriginalAppIdleConsts = getAppIdleConstants();
- setAppIdleConstants(KEY_PAROLE_DURATION + "=" + DESIRED_PAROLE_DURATION + ","
- + KEY_STABLE_CHARGING_THRESHOLD + "=" + DESIRED_STABLE_CHARGING_THRESHOLD);
- LogUtil.CLog.d("Original app_idle_constants: " + mOriginalAppIdleConsts);
- }
-
- @Override
- public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable throwable)
- throws DeviceNotAvailableException {
- setAppIdleConstants(mOriginalAppIdleConsts);
- }
-
- private void setAppIdleConstants(String appIdleConstants) throws DeviceNotAvailableException {
- executeCmd("settings put global app_idle_constants \"" + appIdleConstants + "\"");
- }
-
- private String getAppIdleConstants() throws DeviceNotAvailableException {
- return executeCmd("settings get global app_idle_constants");
- }
-
- private String executeCmd(String cmd) throws DeviceNotAvailableException {
- final String output = mDevice.executeShellCommand(cmd).trim();
- LogUtil.CLog.d("Output for '%s': %s", cmd, output);
- return output;
- }
-}