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

Commit d81b8993 authored by Jorge Gil's avatar Jorge Gil
Browse files

Guard app handle hiding on immersive changes behind a flag

Hiding & showing the app handle in response to immersive mode changes
causes flakiness in LayoutTests. This change puts the logic behind a
flag so that it's disabled until the test failures are fixed.

Fix: 335832294
Bug: 336368019
Test: atest
CtsWindowManagerDeviceAnimations:android.server.wm.animations.LayoutTests#testLayoutAfterRemovingFocus
--rerun-until-failure (passes with 200+ attempts with flag disabled)
Test: manual - with flag enabled, the app handle is shown/hidden on
immersive mode changes

Change-Id: Iebc6498e4726d3edeb33d246353a00cbd230ee72
parent 9eaedae1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                final boolean inImmersiveMode = !source.isVisible();
                // Calls WindowDecoration#relayout if decoration visibility needs to be updated
                if (inImmersiveMode != mInImmersiveMode) {
                    if (Flags.enableDesktopWindowingImmersiveHandleHiding()) {
                        decor.relayout(decor.mTaskInfo);
                    }
                    mInImmersiveMode = inImmersiveMode;
                }

+10 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ import android.hardware.display.DisplayManager
import android.hardware.display.VirtualDisplay
import android.os.Handler
import android.platform.test.annotations.EnableFlags
import android.platform.test.annotations.RequiresFlagsEnabled
import android.platform.test.flag.junit.CheckFlagsRule
import android.platform.test.flag.junit.DeviceFlagsValueProvider
import android.platform.test.flag.junit.SetFlagsRule
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
@@ -97,6 +100,10 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
    @Rule
    val setFlagsRule = SetFlagsRule()

    @JvmField
    @Rule
    val mCheckFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()

    @Mock private lateinit var mockDesktopModeWindowDecorFactory:
            DesktopModeWindowDecoration.Factory
    @Mock private lateinit var mockMainHandler: Handler
@@ -306,6 +313,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_IMMERSIVE_HANDLE_HIDING)
    fun testRelayoutRunsWhenStatusBarsInsetsSourceVisibilityChanges() {
        val task = createTask(windowingMode = WINDOWING_MODE_FREEFORM, focused = true)
        val decoration = setUpMockDecorationForTask(task)
@@ -326,6 +334,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_IMMERSIVE_HANDLE_HIDING)
    fun testRelayoutDoesNotRunWhenNonStatusBarsInsetsSourceVisibilityChanges() {
        val task = createTask(windowingMode = WINDOWING_MODE_FREEFORM, focused = true)
        val decoration = setUpMockDecorationForTask(task)
@@ -346,6 +355,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_IMMERSIVE_HANDLE_HIDING)
    fun testRelayoutDoesNotRunWhenNonStatusBarsInsetSourceVisibilityDoesNotChange() {
        val task = createTask(windowingMode = WINDOWING_MODE_FREEFORM, focused = true)
        val decoration = setUpMockDecorationForTask(task)