diff options
Diffstat (limited to 'hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java')
-rw-r--r-- | hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java index c87a7f8d7f4..d1773d0e8e6 100644 --- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java +++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java @@ -70,6 +70,7 @@ public class DeviceOwnerTest extends BaseDeviceOwnerTest { private static final String TEST_APP_LOCATION = "/data/local/tmp/cts/packageinstaller/"; private static final String ARG_NETWORK_LOGGING_BATCH_COUNT = "batchCount"; + private static final String ARG_PID_BEFORE_STOP = "pidOfSimpleapp"; private static final String LAUNCHER_TESTS_HAS_LAUNCHER_ACTIVITY_APK = "CtsHasLauncherActivityApp.apk"; @@ -1059,13 +1060,16 @@ public class DeviceOwnerTest extends BaseDeviceOwnerTest { */ private void tryFgsStoppingProtectedPackage(int userId, boolean canUserStopPackage) throws Exception { + String pid = executeShellCommand(String.format("pidof %s", SIMPLE_APP_PKG)).trim(); fgsStopPackageForUser(SIMPLE_APP_PKG, userId); if (canUserStopPackage) { executeDeviceTestMethod(".UserControlDisabledPackagesTest", - "testFgsStopWithUserControlEnabled"); + "testFgsStopWithUserControlEnabled", + Collections.singletonMap(ARG_PID_BEFORE_STOP, pid)); } else { executeDeviceTestMethod(".UserControlDisabledPackagesTest", - "testFgsStopWithUserControlDisabled"); + "testFgsStopWithUserControlDisabled", + Collections.singletonMap(ARG_PID_BEFORE_STOP, pid)); } } |