Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 514fc731 authored by Kevin Neas's avatar Kevin Neas
Browse files

Updating AppLaunchWear to add more logging.

Test: local
Change-Id: Ib29afa44819c053789dd956d655395f205b89f64
parent 437680c4
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -231,7 +231,7 @@ public class AppLaunch extends InstrumentationTestCase {
                dropCache();
                dropCache();
                String appPkgName = mNameToIntent.get(launch.getApp())
                String appPkgName = mNameToIntent.get(launch.getApp())
                        .getComponent().getPackageName();
                        .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
                // App launch times for trial launch will not be used for final
                // launch time calculations.
                // launch time calculations.
                if (launch.getLaunchReason().equals(TRIAL_LAUNCH)) {
                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
                    // In the "applaunch.txt" file app launches are referenced using
                    // "LAUNCH_ITERATION - ITERATION NUM"
                    // "LAUNCH_ITERATION - ITERATION NUM"
                    if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) {
                    if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) {
                        Log.v(TAG, "Home package detected. Not killing app");
                        launchResults = startApp(launch.getApp(), false, launch.getLaunchReason());
                        launchResults = startApp(launch.getApp(), false, launch.getLaunchReason());
                    } else {
                    } else {
                        Log.v(TAG, "Will kill app before launch");
                        launchResults = startApp(launch.getApp(), true, launch.getLaunchReason());
                        launchResults = startApp(launch.getApp(), true, launch.getLaunchReason());
                    }
                    }
                    if (launchResults.mLaunchTime < 0) {
                    if (launchResults.mLaunchTime < 0) {
@@ -707,7 +709,12 @@ public class AppLaunch extends InstrumentationTestCase {
                String packageName = mLaunchIntent.getComponent().getPackageName();
                String packageName = mLaunchIntent.getComponent().getPackageName();
                String componentName = mLaunchIntent.getComponent().flattenToShortString();
                String componentName = mLaunchIntent.getComponent().flattenToShortString();
                if (mForceStopBeforeLaunch) {
                if (mForceStopBeforeLaunch) {
                    Log.v(TAG, "Stopping app before launch");
                    mAm.forceStopPackage(packageName, UserHandle.USER_CURRENT);
                    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);
                String launchCmd = String.format("%s %s", APP_LAUNCH_CMD, componentName);
                if (mSimplePerfAppOnly) {
                if (mSimplePerfAppOnly) {