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

Commit 6632b0ce authored by Chilun's avatar Chilun
Browse files

Don't allow enabling system decorations for untrusted virtual displays (2/2)

We should only allow enabling system decorations and IME for trusted
virtual displays.

Bug: 130284250
Test: atest MultiDisplaySystemDecorationTests
Change-Id: Ic897b6917c62f7b010e37ee6acaf74efd2508dd4
parent 891aed2a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -6891,6 +6891,10 @@ public class WindowManagerService extends IWindowManager.Stub
                        + "not exist: " + displayId);
                return;
            }
            if (displayContent.isUntrustedVirtualDisplay()) {
                throw new SecurityException("Attempted to set system decors flag to an untrusted "
                        + "virtual display: " + displayId);
            }

            mDisplayWindowSettings.setShouldShowSystemDecorsLocked(displayContent, shouldShow);

@@ -6932,6 +6936,10 @@ public class WindowManagerService extends IWindowManager.Stub
                        + displayId);
                return;
            }
            if (displayContent.isUntrustedVirtualDisplay()) {
                throw new SecurityException("Attempted to set IME flag to an untrusted "
                        + "virtual display: " + displayId);
            }

            mDisplayWindowSettings.setShouldShowImeLocked(displayContent, shouldShow);