From bc642d878ed48cbc35693fcbda93c76468ea1fce Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Mon, 22 Jan 2018 19:28:21 -0800 Subject: [PATCH] Fix netpolicy cts failures due to missing FLAG_ACTIVITY_NEW_TASK. Bug: 72219677 Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \ com.android.cts.net.HostsideRestrictBackgroundNetworkTests Change-Id: I076e10b09f7d8a65120e62ed50afb2d326b62267 --- .../hostside/AbstractRestrictBackgroundNetworkTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 80fd22235f..47ab9faed8 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 @@ -1013,7 +1013,8 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation private Intent getIntentForComponent(int type) { final Intent intent = new Intent(); if (type == TYPE_COMPONENT_ACTIVTIY) { - intent.setComponent(new ComponentName(TEST_APP2_PKG, TEST_APP2_ACTIVITY_CLASS)); + intent.setComponent(new ComponentName(TEST_APP2_PKG, TEST_APP2_ACTIVITY_CLASS)) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } else if (type == TYPE_COMPONENT_FOREGROUND_SERVICE) { intent.setComponent(new ComponentName(TEST_APP2_PKG, TEST_APP2_SERVICE_CLASS)) .setFlags(1);