Skip to content
Snippets Groups Projects
Commit 375f6bba authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

Re-enable the tests for background restrictions

The feature is now turned on so the tests can be re-enabled.
This reverts commit 62663423.

Test: atest CtsHostsideNetworkTests

Bug: 304347838
Change-Id: I85f462e75931240bde8b0dd956c0011ec8435b8f
parent 9a5aaacc
No related branches found
No related tags found
No related merge requests found
...@@ -160,10 +160,6 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { ...@@ -160,10 +160,6 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
private static final long BROADCAST_TIMEOUT_MS = 5_000; 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 Context mContext;
protected Instrumentation mInstrumentation; protected Instrumentation mInstrumentation;
protected ConnectivityManager mCm; protected ConnectivityManager mCm;
...@@ -233,8 +229,9 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { ...@@ -233,8 +229,9 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
} }
final String output = executeShellCommand("device_config get backstage_power" final String output = executeShellCommand("device_config get backstage_power"
+ " com.android.server.net.network_blocked_for_top_sleeping_and_above"); + " 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 { protected int getUid(String packageName) throws Exception {
return mContext.getPackageManager().getPackageUid(packageName, 0); return mContext.getPackageManager().getPackageUid(packageName, 0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment