diff options
author | Kevin Neas <kneas@google.com> | 2018-02-20 16:13:20 -0800 |
---|---|---|
committer | Kevin Neas <kneas@google.com> | 2018-02-21 04:37:05 +0000 |
commit | 514fc731221384f45302841e0f6336ad9dfccc89 (patch) | |
tree | 557dacd725801bc99cc597b6ad140049c79c79c0 | |
parent | 437680c4ff4a33c7377b22cc39209561ae2e3b55 (diff) |
Updating AppLaunchWear to add more logging.
Test: local
Change-Id: Ib29afa44819c053789dd956d655395f205b89f64
-rw-r--r-- | tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java index f32464bf84c2..acb5d77113b8 100644 --- a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java +++ b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java @@ -231,7 +231,7 @@ public class AppLaunch extends InstrumentationTestCase { dropCache(); String appPkgName = mNameToIntent.get(launch.getApp()) .getComponent().getPackageName(); - + 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)) { @@ -276,8 +276,10 @@ public class AppLaunch extends InstrumentationTestCase { // In the "applaunch.txt" file app launches are referenced using // "LAUNCH_ITERATION - ITERATION NUM" if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) { + Log.v(TAG, "Home package detected. Not killing app"); launchResults = startApp(launch.getApp(), false, launch.getLaunchReason()); } else { + Log.v(TAG, "Will kill app before launch"); launchResults = startApp(launch.getApp(), true, launch.getLaunchReason()); } if (launchResults.mLaunchTime < 0) { @@ -707,7 +709,12 @@ public class AppLaunch extends InstrumentationTestCase { String packageName = mLaunchIntent.getComponent().getPackageName(); String componentName = mLaunchIntent.getComponent().flattenToShortString(); if (mForceStopBeforeLaunch) { + Log.v(TAG, "Stopping app before launch"); mAm.forceStopPackage(packageName, UserHandle.USER_CURRENT); + } else { + Log.v(TAG, "Not killing app. Going to Home Screen."); + ParcelFileDescriptor goHome = getInstrumentation().getUiAutomation() + .executeShellCommand("input keyevent 3"); } String launchCmd = String.format("%s %s", APP_LAUNCH_CMD, componentName); if (mSimplePerfAppOnly) { |