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

Commit 462b8f5f authored by Garfield Tan's avatar Garfield Tan
Browse files

Don't throw when setting the same windowing mode

We may throw UnsupportedOperationException when setting windowing mode
other than fullscreen or unspecified in the locked task mode. However if
the container in question is already in the same mode there is no need
to fail the request.

Bug: 263492303
Test: Build and boot.
Change-Id: I55caa81b0c5a259ae39785c0ef473e12aa8b3286
parent 9882b54f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -658,7 +658,8 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
            }
        }

        if (windowingMode > -1) {
        final int prevWindowingMode = container.getWindowingMode();
        if (windowingMode > -1 && prevWindowingMode != windowingMode) {
            if (mService.isInLockTaskMode()
                    && WindowConfiguration.inMultiWindowMode(windowingMode)) {
                throw new UnsupportedOperationException("Not supported to set multi-window"
@@ -672,9 +673,8 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                return effects;
            }

            final int prevMode = container.getWindowingMode();
            container.setWindowingMode(windowingMode);
            if (prevMode != container.getWindowingMode()) {
            if (prevWindowingMode != container.getWindowingMode()) {
                // The activity in the container may become focusable or non-focusable due to
                // windowing modes changes (such as entering or leaving pinned windowing mode),
                // so also apply the lifecycle effects to this transaction.