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

Commit 78fae987 authored by Lingyu Feng's avatar Lingyu Feng Committed by Android (Google) Code Review
Browse files

Merge "Change VirtualDisplayAdapter#shouldOnlyMirror()" into main

parents 5b687677 32231ad2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+4 −3
Original line number Diff line number Diff line
@@ -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;
        }

+2 −0
Original line number Diff line number Diff line
@@ -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) {
+2 −1
Original line number Diff line number Diff line
@@ -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();