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

Commit 0b91c52d authored by David Lin's avatar David Lin Committed by Automerger Merge Worker
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 am: 16418410

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/27467255



Change-Id: I112b791f860402b3345a0d1699f91c7e023a45cb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 26b25da3 16418410
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ import static android.provider.Settings.Secure.RESOLUTION_MODE_FULL;
import static android.provider.Settings.Secure.RESOLUTION_MODE_HIGH;
import static android.provider.Settings.Secure.RESOLUTION_MODE_UNKNOWN;

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

import android.Manifest;
import android.annotation.EnforcePermission;
import android.annotation.NonNull;
@@ -4972,8 +4974,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