From e5d3d7eb4e81d344a6a634a39d6b384a5e72403d Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Thu, 13 Feb 2020 12:21:38 +0800 Subject: [PATCH] Force stop app if it has failures during trial launch Activities could be remained at foreground when it has failures in trial launch, which affects testing results of other apps. Bug: 149326995 Test: atest google/perf/app-startup/hermetic-apps/cold-dropcache-test Change-Id: Id364461ff5a97384590d1dc7cfb59cc8cf4e88a6 --- tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java index 95b8f6700c769..da45d9a258bda 100644 --- a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java +++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java @@ -296,6 +296,8 @@ public class AppLaunch extends InstrumentationTestCase { AppLaunchResult launchResults = null; if (hasFailureOnFirstLaunch(launch)) { // skip if the app has failures while launched first + Log.w(TAG, "Has failures on first launch: " + launch.getApp()); + forceStopApp(launch.getApp()); continue; } AtraceLogger atraceLogger = null;