Updating AppLaunchWear with more logging and logic.
Agenda keeps failing. Need to more logging to know why
Contacts keeps getting killed. Again, need more logging
Test: local
Change-Id: I6930892d8a2eaa7ad410284fba9ed1c4980820f7
diff --git a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
index acb5d77..b3f2686 100644
--- a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
@@ -231,12 +231,14 @@
dropCache();
String appPkgName = mNameToIntent.get(launch.getApp())
.getComponent().getPackageName();
+ Log.v(TAG, String.format("\nApp name: %s", launch.getApp()));
Log.v(TAG, String.format("Adding app package name: %s", appPkgName));
// App launch times for trial launch will not be used for final
// launch time calculations.
if (launch.getLaunchReason().equals(TRIAL_LAUNCH)) {
// In the "applaunch.txt" file, trail launches is referenced using
// "TRIAL_LAUNCH"
+ Log.v(TAG, "Trial Launch");
if (SPEED_PROFILE_FILTER.equals(launch.getCompilerFilter())) {
assertTrue(String.format("Not able to compile the app : %s", appPkgName),
compileApp(VERIFY_FILTER, appPkgName));
@@ -246,8 +248,14 @@
}
// We only need to run a trial for the speed-profile filter, but we always
// run one for "applaunch.txt" consistency.
- AppLaunchResult launchResult =
- startApp(launch.getApp(), true, launch.getLaunchReason());
+ AppLaunchResult launchResult = null;
+ if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) {
+ Log.v(TAG, "Home package detected. Not killing app");
+ launchResult = startApp(launch.getApp(), false, launch.getLaunchReason());
+ } else {
+ Log.v(TAG, "Will kill app before launch");
+ launchResult = startApp(launch.getApp(), true, launch.getLaunchReason());
+ }
if (launchResult.mLaunchTime < 0) {
addLaunchResult(launch, new AppLaunchResult());
// simply pass the app if launch isn't successful
@@ -268,6 +276,7 @@
// App launch times used for final calculation
else if (launch.getLaunchReason().contains(LAUNCH_ITERATION_PREFIX)) {
+ Log.v(TAG, "Launch iteration prefix.");
AppLaunchResult launchResults = null;
if (hasFailureOnFirstLaunch(launch)) {
// skip if the app has failures while launched first
@@ -295,6 +304,7 @@
// App launch times for trace launch will not be used for final
// launch time calculations.
else if (launch.getLaunchReason().contains(TRACE_ITERATION_PREFIX)) {
+ Log.v(TAG, "Trace iteration prefix");
AtraceLogger atraceLogger = AtraceLogger
.getAtraceLoggerInstance(getInstrumentation());
// Start the trace
@@ -302,7 +312,13 @@
atraceLogger.atraceStart(traceCategoriesSet, traceBufferSize,
traceDumpInterval, rootTraceSubDir,
String.format("%s-%s", launch.getApp(), launch.getLaunchReason()));
- startApp(launch.getApp(), true, launch.getLaunchReason());
+ if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) {
+ Log.v(TAG, "Home package detected. Not killing app");
+ startApp(launch.getApp(), false, launch.getLaunchReason());
+ } else {
+ Log.v(TAG, "Will kill app before launch");
+ startApp(launch.getApp(), true, launch.getLaunchReason());
+ }
sleep(POST_LAUNCH_IDLE_TIMEOUT);
} finally {
// Stop the trace