Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +3 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt +10 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading @@ -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) Loading @@ -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) Loading @@ -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) Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +3 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt +10 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading @@ -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) Loading @@ -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) Loading @@ -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) Loading