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

Commit 0d5d6279 authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "Caption/DesktopWindowDecor: don't show window decor for private display." into main

parents 1d63ef21 ba537f04
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -284,6 +284,10 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel, FocusT
    }

    private boolean shouldShowWindowDecor(RunningTaskInfo taskInfo) {
        if (mDisplayController.getDisplay(taskInfo.displayId) == null) {
            // If DisplayController doesn't have it tracked, it could be a private/managed display.
            return false;
        }
        if (taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
            return true;
        }
+4 −0
Original line number Diff line number Diff line
@@ -1643,6 +1643,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
    }

    private boolean shouldShowWindowDecor(RunningTaskInfo taskInfo) {
        if (mDisplayController.getDisplay(taskInfo.displayId) == null) {
            // If DisplayController doesn't have it tracked, it could be a private/managed display.
            return false;
        }
        if (taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) return true;
        if (mSplitScreenController != null
                && mSplitScreenController.isTaskRootOrStageRoot(taskInfo.taskId)) {
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.platform.test.flag.junit.SetFlagsRule
import android.testing.TestableContext
import android.util.SparseArray
import android.view.Choreographer
import android.view.Display
import android.view.Display.DEFAULT_DISPLAY
import android.view.IWindowManager
import android.view.InputChannel
@@ -157,6 +158,7 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() {
    protected val mockRecentsTransitionHandler = mock<RecentsTransitionHandler>()
    protected val motionEvent = mock<MotionEvent>()
    val displayLayout = mock<DisplayLayout>()
    val display = mock<Display>()
    protected lateinit var spyContext: TestableContext
    private lateinit var desktopModeEventLogger: DesktopModeEventLogger

@@ -183,6 +185,7 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() {
        desktopModeEventLogger = mock<DesktopModeEventLogger>()
        whenever(mockDesktopUserRepositories.current).thenReturn(mockDesktopRepository)
        whenever(mockDisplayController.getDisplayContext(any())).thenReturn(spyContext)
        whenever(mockDisplayController.getDisplay(any())).thenReturn(display)
        whenever(mockDesktopUserRepositories.getProfile(anyInt()))
            .thenReturn(mockDesktopRepository)
        desktopModeWindowDecorViewModel = DesktopModeWindowDecorViewModel(