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

Commit 64645c04 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "4-2/ Enhance AbstractStandardAppHelper.exit() to exit PIP at end"

parents c9f50b17 a6c32cc9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -70,8 +70,8 @@ class AppPairsTest(
                eachRun {
                    executeShellCommand(composePairsCommand(
                            primaryTaskId, secondaryTaskId, false /* pair */))
                    primaryApp.forceStop()
                    secondaryApp.forceStop()
                    primaryApp.exit()
                    secondaryApp.exit()
                }
            }
            assertions {
+0 −8
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.helpers

import android.app.ActivityManager
import android.app.Instrumentation
import android.content.ComponentName
import android.content.Context
@@ -46,9 +45,6 @@ abstract class BaseAppHelper(
    protected val context: Context
        get() = mInstrumentation.context

    private val activityManager: ActivityManager?
        get() = context.getSystemService(ActivityManager::class.java)

    private val appSelector = By.pkg(packageName).depth(0)

    protected val isTelevision: Boolean
@@ -77,10 +73,6 @@ abstract class BaseAppHelper(
        return uiDevice.wait(Until.gone(appSelector), APP_CLOSE_WAIT_TIME_MS)
    }

    fun forceStop() {
        activityManager?.forceStopPackage(packageName)
    }

    override fun getOpenAppIntent(): Intent {
        val intent = Intent()
        intent.component = launcherActivityComponent
+3 −3
Original line number Diff line number Diff line
@@ -76,12 +76,12 @@ class PipKeyboardTest(
            }
            teardown {
                test {
                    keyboardApp.forceStop()
                    keyboardApp.exit()

                    if (device.hasPipWindow()) {
                        device.closePipWindow()
                    }
                    testApp.forceStop()
                    testApp.exit()
                    this.setRotation(Surface.ROTATION_0)
                }
            }
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ abstract class TvPipTestBase : PipTestBase(rotationToString(ROTATION_0), ROTATIO
    open fun tearDown() {
        if (!isTelevision) return

        testApp.forceStop()
        testApp.exit()

        // Wait for 1 second, and check if the SystemUI has been alive and well since the start.
        SystemClock.sleep(AFTER_TEXT_PROCESS_CHECK_DELAY)
+2 −2
Original line number Diff line number Diff line
@@ -60,8 +60,8 @@ class EnterSplitScreenTest(
            }
            teardown {
                eachRun {
                    splitScreenApp.forceStop()
                    secondaryApp.forceStop()
                    splitScreenApp.exit()
                    secondaryApp.exit()
                }
            }
            assertions {
Loading