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

Commit e09cb245 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure to open an app as a new task" into main

parents 8d9dcb38 5f3d9373
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.wm.shell.scenarios

import android.app.Instrumentation
import android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -43,7 +45,7 @@ abstract class OpenUnlimitedApps()
    private val device = UiDevice.getInstance(instrumentation)

    private val testApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation))
    private val mailApp = DesktopModeAppHelper(MailAppHelper(instrumentation))
    private val mailApp = MailAppHelper(instrumentation)

    private val maxNum = DesktopModeStatus.getMaxTaskLimit(instrumentation.context)

@@ -61,7 +63,12 @@ abstract class OpenUnlimitedApps()

        // Launch new [openTaskNum] tasks.
        for (i in 1..openTaskNum) {
            mailApp.launchViaIntent(wmHelper)
            mailApp.launchViaIntent(
                wmHelper,
                mailApp.openAppIntent.apply {
                    addFlags(FLAG_ACTIVITY_MULTIPLE_TASK or FLAG_ACTIVITY_NEW_TASK)
                }
            )
        }
    }