From b11b071422ae42414cb0000d1c6b7d4f0765b31a Mon Sep 17 00:00:00 2001 From: Suprabh Shukla Date: Sat, 9 Mar 2024 04:21:53 +0000 Subject: [PATCH] Revert^4 "Re-enable the tests for background restrictions" 7ff923029edfc977f925903210fb21d77d3c305a Reason for revert: b/327713895 was a false alarm. Change-Id: Ia6742630eece19eeb8bdfa25f861726c7237ab6d --- .../AbstractRestrictBackgroundNetworkTestCase.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 1241e18f56..2ca88325cf 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 @@ -160,10 +160,6 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { private static final long BROADCAST_TIMEOUT_MS = 5_000; - // Should be kept in sync with the constant in NetworkPolicyManagerService. - // TODO: b/322115994 - remove once the feature is in staging. - private static final boolean ALWAYS_RESTRICT_BACKGROUND_NETWORK = false; - protected Context mContext; protected Instrumentation mInstrumentation; protected ConnectivityManager mCm; @@ -233,8 +229,9 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { } final String output = executeShellCommand("device_config get backstage_power" + " com.android.server.net.network_blocked_for_top_sleeping_and_above"); - return Boolean.parseBoolean(output) && ALWAYS_RESTRICT_BACKGROUND_NETWORK; + return Boolean.parseBoolean(output); } + protected int getUid(String packageName) throws Exception { return mContext.getPackageManager().getPackageUid(packageName, 0); }