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

Commit 6cfdb712 authored by Lingyu Feng's avatar Lingyu Feng
Browse files

Don't allow content mode switch on rear display

Bug: 398377735
Test: CtsWindowManagerJetpackTestCases
Flag:com.android.server.display.feature.flags.enable_display_content_mode_management

Change-Id: Ib8bc80da643138a5d9b9c821e7e43fdc87b6db0b
parent 2f39979e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3271,7 +3271,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            return false;
        }

        // TODO(b/391965805): Remove this after introducing FLAG_ALLOW_SYSTEM_DECORATIONS_CHANGE.
        // TODO(b/391965805): Remove this after introducing FLAG_ALLOW_CONTENT_MODE_SWITCH.
        if ((mDisplay.getFlags() & Display.FLAG_REAR) != 0) {
            return false;
        }

        // TODO(b/391965805): Remove this after introducing FLAG_ALLOW_CONTENT_MODE_SWITCH.
        // Virtual displays cannot add or remove system decorations during their lifecycle.
        if (mDisplay.getType() == Display.TYPE_VIRTUAL) {
            return false;