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

Commit 37132183 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by Android (Google) Code Review
Browse files

Merge "Small cleanup in AppLaunch."

parents 299b0e4b aacac603
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ public class AppLaunch extends InstrumentationTestCase {
                        atraceLogger.atraceStop();
                    }
                }
                closeApp(launch.getApp(), true);
                closeApp(launch.getApp());
                sleep(BETWEEN_LAUNCH_SLEEP_TIMEOUT);
            }
        } finally {
@@ -575,14 +575,16 @@ public class AppLaunch extends InstrumentationTestCase {
        }
    }

    private void closeApp(String appName, boolean forceStopApp) {
    private void startHomeIntent() {
        Intent homeIntent = new Intent(Intent.ACTION_MAIN);
        homeIntent.addCategory(Intent.CATEGORY_HOME);
        homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
        getInstrumentation().getContext().startActivity(homeIntent);
        sleep(POST_LAUNCH_IDLE_TIMEOUT);
        if (forceStopApp) {
    }

    private void closeApp(String appName) {
        Intent startIntent = mNameToIntent.get(appName);
        if (startIntent != null) {
            String packageName = startIntent.getComponent().getPackageName();
@@ -593,7 +595,6 @@ public class AppLaunch extends InstrumentationTestCase {
            }
        }
    }
    }

    private void sleep(int time) {
        try {