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

Commit 735c7642 authored by Kenneth Ford's avatar Kenneth Ford
Browse files

Add rear display check to determine if mirroring of other displays should be disabled

Bug: 333678561
Test: Manual
 1) Enable dual display feature and confirm smooth presentation
 2) Enable desktop mirroring and confirm feature works
Change-Id: I0bf4f2689a4fd7687f15c097bf50b9cf7556354e
parent a11d1e29
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_CRITICAL;
import static android.os.Process.FIRST_APPLICATION_UID;
import static android.os.Process.ROOT_UID;

import static com.android.server.display.layout.Layout.Display.POSITION_REAR;

import android.Manifest;
import android.annotation.EnforcePermission;
import android.annotation.NonNull;
@@ -4864,8 +4866,9 @@ public final class DisplayManagerService extends SystemService {
                }

                final DisplayDevice displayDevice = display.getPrimaryDisplayDeviceLocked();
                final boolean ownContent = (displayDevice.getDisplayDeviceInfoLocked().flags
                        & DisplayDeviceInfo.FLAG_OWN_CONTENT_ONLY) != 0;
                final boolean isRearDisplay = display.getDevicePositionLocked() == POSITION_REAR;
                final boolean ownContent = ((displayDevice.getDisplayDeviceInfoLocked().flags
                        & DisplayDeviceInfo.FLAG_OWN_CONTENT_ONLY) != 0) || isRearDisplay;
                // If the display has enabled mirroring, but specified that it will be managed by
                // WindowManager, return an invalid display id. This is to ensure we don't
                // accidentally select the display id to mirror based on DM logic and instead allow