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

Commit dce3abf8 authored by Garfield Tan's avatar Garfield Tan Committed by Android (Google) Code Review
Browse files

Merge "Drop multi-window mode requests in locked task mode" into udc-dev

parents 2927a36d 2e62db34
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -684,12 +684,12 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
            }
            }
        }
        }


        final int prevWindowingMode = container.getRequestedOverrideWindowingMode();
        if (windowingMode > -1) {
        if (windowingMode > -1 && prevWindowingMode != windowingMode) {
            if (mService.isInLockTaskMode()
            if (mService.isInLockTaskMode()
                    && WindowConfiguration.inMultiWindowMode(windowingMode)) {
                    && WindowConfiguration.inMultiWindowMode(windowingMode)) {
                throw new UnsupportedOperationException("Not supported to set multi-window"
                Slog.w(TAG, "Dropping unsupported request to set multi-window windowing mode"
                        + " windowing mode during locked task mode.");
                        + " during locked task mode.");
                return effects;
            }
            }


            if (windowingMode == WindowConfiguration.WINDOWING_MODE_PINNED) {
            if (windowingMode == WindowConfiguration.WINDOWING_MODE_PINNED) {
@@ -699,8 +699,9 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                return effects;
                return effects;
            }
            }


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