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

Commit 882873b6 authored by Massimo Carli's avatar Massimo Carli
Browse files

[28/n] Hide letterbox surfaces when activity is not letterboxed

The visibility of the letterbox surfaces is already handled
in the related LetterboxController. The only case when the
letterbox surfaces need to be explicitly and completely hidden
is when the top activity is not letterboxed.

Flag: com.android.window.flags.app_compat_refactoring
Fix: 384473893
Test: atest WMShellUnitTests:LetterboxTransitionObserverTest

Change-Id: Id3ab5e60c1a4aef4fb795ab600a38872128874f8
parent 8fb00be7
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -98,13 +98,14 @@ class LetterboxTransitionObserver(
                                taskBounds,
                                activityBounds
                            )
                        }
                        } else {
                            updateLetterboxSurfaceVisibility(
                                key,
                                startTransaction,
                            isTopActivityLetterboxed
                                visible = false
                            )
                        }
                    }
                    dump()
                }
            }
+3 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ class LetterboxTransitionObserverTest : ShellTestCase() {
                validateOutput {
                    r.creationEventDetected(expected = true)
                    r.configureStrategyInvoked(expected = true)
                    r.visibilityEventDetected(expected = true, visible = true)
                    r.visibilityEventDetected(expected = false)
                    r.destroyEventDetected(expected = false)
                    r.updateSurfaceBoundsEventDetected(
                        expected = true,
@@ -264,6 +264,7 @@ class LetterboxTransitionObserverTest : ShellTestCase() {
            any<WindowContainerToken>()
        )

        // Visible param is used only if expected is true.
        fun visibilityEventDetected(
            expected: Boolean,
            visible: Boolean = true,
@@ -272,7 +273,7 @@ class LetterboxTransitionObserverTest : ShellTestCase() {
        ) = verify(letterboxController, expected.asMode()).updateLetterboxSurfaceVisibility(
            eq(LetterboxKey(displayId, taskId)),
            any<SurfaceControl.Transaction>(),
            eq(visible)
            if (expected) eq(visible) else any()
        )

        fun destroyEventDetected(