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

Commit 2c8858ba authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't override child task bounds when rotation changed" into sc-dev am: a7165e25

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I45c694e9bd26ea3972560145e95a6d5f055a9c8d
parents d277022c a7165e25
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -2319,12 +2319,9 @@ class Task extends WindowContainer<WindowContainer> {
            return;
        }

        final boolean windowingModeChanged = prevWindowingMode != getWindowingMode();
        final int overrideWindowingMode = getRequestedOverrideWindowingMode();
        // Update bounds if applicable
        boolean hasNewOverrideBounds = false;
        // Use override windowing mode to prevent extra bounds changes if inheriting the mode.
        if ((overrideWindowingMode != WINDOWING_MODE_PINNED)
        final int overrideWindowingMode = getRequestedOverrideWindowingMode();
        if (overrideWindowingMode != WINDOWING_MODE_PINNED
                && !getRequestedOverrideBounds().isEmpty()) {
            // If the parent (display) has rotated, rotate our bounds to best-fit where their
            // bounds were on the pre-rotated display.
@@ -2334,22 +2331,10 @@ class Task extends WindowContainer<WindowContainer> {
                mDisplayContent.rotateBounds(
                        newParentConfig.windowConfiguration.getBounds(), prevRotation, newRotation,
                        newBounds);
                hasNewOverrideBounds = true;
            }
        }

        if (windowingModeChanged) {
            taskDisplayArea.onRootTaskWindowingModeChanged(this);
        }
        if (hasNewOverrideBounds) {
            if (inSplitScreenWindowingMode()) {
                setBounds(newBounds);
            } else if (overrideWindowingMode != WINDOWING_MODE_PINNED) {
                // For root pinned task, resize is now part of the {@link
                // WindowContainerTransaction}
                resize(new Rect(newBounds), PRESERVE_WINDOWS, true /* deferResume */);
            }
        }

        if (prevIsAlwaysOnTop != isAlwaysOnTop()) {
            // Since always on top is only on when the root task is freeform or pinned, the state
            // can be toggled when the windowing mode changes. We must make sure the root task is
+0 −17
Original line number Diff line number Diff line
@@ -416,11 +416,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                        new Configuration(container.getRequestedOverrideConfiguration());
                c.setTo(change.getConfiguration(), configMask, windowMask);
                container.onRequestedOverrideConfigurationChanged(c);
                // TODO(b/145675353): remove the following once we could apply new bounds to the
                // root pinned task together with its children.
            }
            resizeRootPinnedTaskIfNeeded(container, configMask, windowMask,
                    container.getRequestedOverrideConfiguration());
            effects |= TRANSACT_EFFECTS_CLIENT_CONFIG;
        }
        if ((change.getChangeMask() & WindowContainerTransaction.Change.CHANGE_FOCUSABLE) != 0) {
@@ -670,19 +666,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
        return effects;
    }

    private void resizeRootPinnedTaskIfNeeded(ConfigurationContainer container, int configMask,
            int windowMask, Configuration config) {
        if ((container instanceof Task)
                && ((configMask & ActivityInfo.CONFIG_WINDOW_CONFIGURATION) != 0)
                && ((windowMask & WindowConfiguration.WINDOW_CONFIG_BOUNDS) != 0)) {
            final Task rootTask = (Task) container;
            if (rootTask.inPinnedWindowingMode()) {
                rootTask.resize(config.windowConfiguration.getBounds(),
                        PRESERVE_WINDOWS, true /* deferResume */);
            }
        }
    }

    @Override
    public ITaskOrganizerController getTaskOrganizerController() {
        enforceTaskPermission("getTaskOrganizerController()");