Loading services/core/java/com/android/server/display/VirtualDisplayAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -544,7 +544,7 @@ public class VirtualDisplayAdapter extends DisplayAdapter { @Override public boolean shouldOnlyMirror() { return mProjection != null || ((mFlags & VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR) != 0); return mProjection != null; } public void setSurfaceLocked(Surface surface) { Loading services/core/java/com/android/server/wm/ContentRecorder.java +4 −3 Original line number Diff line number Diff line Loading @@ -365,10 +365,11 @@ final class ContentRecorder implements WindowContainerListener { return; } // Recording should not be started on displays that are eligible for hosting tasks. // See android.view.Display#canHostTasks(). // Recording should not be started on displays that should show system decorations. // See DisplayWindowSettings#shouldShowSystemDecorsLocked(). if (DesktopExperienceFlags.ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue() && mDisplayContent.mDisplay.canHostTasks()) { && mDisplayContent.mWmService.mDisplayWindowSettings .shouldShowSystemDecorsLocked(mDisplayContent)) { return; } Loading services/core/java/com/android/server/wm/DisplayWindowSettings.java +2 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,8 @@ class DisplayWindowSettings { * Returns {@code true} if either the display is the default display, or the display is allowed * to dynamically add/remove system decorations and the system decorations should be shown on it * currently. * * Note that the display should not mirror when this returns {@code true}. */ boolean shouldShowSystemDecorsLocked(@NonNull DisplayContent dc) { if (dc.getDisplayId() == Display.DEFAULT_DISPLAY) { Loading services/tests/wmtests/src/com/android/server/wm/ContentRecorderTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -609,7 +609,8 @@ public class ContentRecorderTests extends WindowTestsBase { mContentRecorder.setContentRecordingSession(mTaskSession); spyOn(mVirtualDisplayContent.mDisplay); doReturn(true).when(mVirtualDisplayContent.mDisplay).canHostTasks(); doReturn(true).when(mWm.mDisplayWindowSettings) .shouldShowSystemDecorsLocked(mVirtualDisplayContent); // WHEN a recording tries to start. mContentRecorder.updateRecording(); Loading Loading
services/core/java/com/android/server/display/VirtualDisplayAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -544,7 +544,7 @@ public class VirtualDisplayAdapter extends DisplayAdapter { @Override public boolean shouldOnlyMirror() { return mProjection != null || ((mFlags & VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR) != 0); return mProjection != null; } public void setSurfaceLocked(Surface surface) { Loading
services/core/java/com/android/server/wm/ContentRecorder.java +4 −3 Original line number Diff line number Diff line Loading @@ -365,10 +365,11 @@ final class ContentRecorder implements WindowContainerListener { return; } // Recording should not be started on displays that are eligible for hosting tasks. // See android.view.Display#canHostTasks(). // Recording should not be started on displays that should show system decorations. // See DisplayWindowSettings#shouldShowSystemDecorsLocked(). if (DesktopExperienceFlags.ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue() && mDisplayContent.mDisplay.canHostTasks()) { && mDisplayContent.mWmService.mDisplayWindowSettings .shouldShowSystemDecorsLocked(mDisplayContent)) { return; } Loading
services/core/java/com/android/server/wm/DisplayWindowSettings.java +2 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,8 @@ class DisplayWindowSettings { * Returns {@code true} if either the display is the default display, or the display is allowed * to dynamically add/remove system decorations and the system decorations should be shown on it * currently. * * Note that the display should not mirror when this returns {@code true}. */ boolean shouldShowSystemDecorsLocked(@NonNull DisplayContent dc) { if (dc.getDisplayId() == Display.DEFAULT_DISPLAY) { Loading
services/tests/wmtests/src/com/android/server/wm/ContentRecorderTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -609,7 +609,8 @@ public class ContentRecorderTests extends WindowTestsBase { mContentRecorder.setContentRecordingSession(mTaskSession); spyOn(mVirtualDisplayContent.mDisplay); doReturn(true).when(mVirtualDisplayContent.mDisplay).canHostTasks(); doReturn(true).when(mWm.mDisplayWindowSettings) .shouldShowSystemDecorsLocked(mVirtualDisplayContent); // WHEN a recording tries to start. mContentRecorder.updateRecording(); Loading