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

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

Merge "Modify app expected position base on the drag behavior change" into tm-qpr-dev

parents 1431dd90 31b85dda
Loading
Loading
Loading
Loading
+14 −30
Original line number Diff line number Diff line
@@ -24,15 +24,14 @@ import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.traces.common.Rect
import com.android.wm.shell.flicker.layerBecomesVisible
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
import com.android.wm.shell.flicker.appWindowBecomesVisible
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
import com.android.wm.shell.flicker.layerBecomesVisible
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisible
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
@@ -76,11 +75,6 @@ class EnterSplitScreenByDragFromAllApps(
                    .getAppIcon(secondaryApp.appName)
                    .dragToSplitscreen(secondaryApp.component.packageName,
                        primaryApp.component.packageName)

                endDisplayBounds = wmHelper.currentState.layerState
                        .displays.firstOrNull { !it.isVirtual }
                        ?.layerStackSpace
                        ?: error("Display not found")
            }
        }

@@ -99,12 +93,12 @@ class EnterSplitScreenByDragFromAllApps(
    @Presubmit
    @Test
    fun primaryAppBoundsIsVisibleAtEnd() = testSpec.splitAppLayerBoundsIsVisibleAtEnd(
            testSpec.endRotation, primaryApp.component, isAppLeftTop(true))
        testSpec.endRotation, primaryApp.component, false /* splitLeftTop */)

    @Presubmit
    @Test
    fun secondaryAppBoundsBecomesVisible() = testSpec.splitAppLayerBoundsBecomesVisible(
            testSpec.endRotation, secondaryApp.component, isAppLeftTop(false))
        testSpec.endRotation, secondaryApp.component, true /* splitLeftTop */)

    @Presubmit
    @Test
@@ -115,14 +109,6 @@ class EnterSplitScreenByDragFromAllApps(
    fun secondaryAppWindowBecomesVisible() =
        testSpec.appWindowBecomesVisible(secondaryApp.component)

    private fun isAppLeftTop(primary: Boolean): Boolean {
        return if (endDisplayBounds.width > endDisplayBounds.height) {
            !primary
        } else {
            primary
        }
    }

    companion object {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
@@ -133,7 +119,5 @@ class EnterSplitScreenByDragFromAllApps(
                supportedNavigationModes =
                    listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY))
        }

        private lateinit var endDisplayBounds: Rect
    }
}