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

Commit 16418410 authored by David Lin's avatar David Lin Committed by Android (Google) Code Review
Browse files

Merge "Add rear display check to determine if mirroring of other displays...

Merge "Add rear display check to determine if mirroring of other displays should be disabled" into 24D1-dev
parents 3e229ec0 735c7642
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line 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.FIRST_APPLICATION_UID;
import static android.os.Process.ROOT_UID;
import static android.os.Process.ROOT_UID;


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

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


                final DisplayDevice displayDevice = display.getPrimaryDisplayDeviceLocked();
                final DisplayDevice displayDevice = display.getPrimaryDisplayDeviceLocked();
                final boolean ownContent = (displayDevice.getDisplayDeviceInfoLocked().flags
                final boolean isRearDisplay = display.getDevicePositionLocked() == POSITION_REAR;
                        & DisplayDeviceInfo.FLAG_OWN_CONTENT_ONLY) != 0;
                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
                // 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
                // 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
                // accidentally select the display id to mirror based on DM logic and instead allow